Find the collection name from document._id in meteor (mongodb) -


from looks of syntax handling mongodb related things in meteor seems need know collection's name update, insert, remove or anything document.

what wondering if it's possible collection's name _id field of document in meteor.

meaning if have document _id equal tntco3bhzosfmxkjt. knowing _id of document want find collection document located in. possible through meteor's implementation of mongodb or vanilla mongodb?

as taken official docs:

idgeneration string

the method of generating _id fields of new documents in collection. possible values:

'string': random strings 'mongo': random meteor.collection.objectid values

the default id generation technique 'string'.

your best option insert records within pseudo transaction second step take id , collection name feed reference collection. then, can lookups that.

it pretty costly, though construct find's might pattern worthwhile exploring if building app users creating arbitrary data patterns.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -