a-musing-moose/morph — Issue #24: Access document 'id' in query
Author: russellseymour
Created: 2012-01-12 16:58:14+00:00
State: open

Good evening,

I have started implementing Morph into my project and things are going really well - thanks for the great library.

However I have got to a stumbling block. How do you get the 'id' of the documents in the returned query?

If I print out a raw output of the returned document I can see that there is a protected $id with the MongoId. However as the documents returned are based on my own class I cannot get access to it using the construct:

$doc -> {'$id'}

Please can you advise as to how I can get the ID of the document?

Thanks very much,

Russell Seymour