Closed neurosnap closed 7 years ago
Collection-level actions are generally class methods of StoredObject
--see StoredObject::find
, StoredObject::remove
, etc.
Thanks! Are there any issues with putting a mongodb specific method in StoredObject? On Mar 30, 2014 9:02 PM, "Joshua Carp" notifications@github.com wrote:
Collection-level actions are generally class methods of StoredObject--see StoredObject::find, StoredObject::remove, etc.
Reply to this email directly or view it on GitHubhttps://github.com/CenterForOpenScience/modular-odm/issues/86#issuecomment-39046441 .
To my knowledge there is nothing on StoredObject
that is specific to any backend - and as far as I know, that's by design at this point.
You might consider either subclassing it to something like MongoStoredObject
, or we'll need to settle on an architecture through which collection-level methods can be exposed in a backend-independent way. Would you be interested in helping define what that might look like?
How would I go about adding functionality at the collection level using modular-odm?
For example, if I would like to map reduce a collection:
http://api.mongodb.org/python/2.0/api/pymongo/collection.html#pymongo.collection.Collection.map_reduce