开发者

MongoDB bulk lookup by bson_id

开发者 https://www.devze.com 2023-03-01 06:26 出处:网络
I\'m using Neo4j for a large graph of data, and using MongoDB to store detailed document information about individual nodes.

I'm using Neo4j for a large graph of data, and using MongoDB to store detailed document information about individual nodes.

I need 开发者_JS百科to be able to take the results of my graph traversals (sometimes up to 1000 bson_ids) and query Mongo for them. I've noticed that even with selects and limits, the performance isn't great.

Any ideas on how I can make this mapping more efficient?


Unfortunately I have no advice regarding fast mongo document retrieval. Perhaps the $in operator helps.

Are you querying mongo directly too on other occasions ? Or are you just querying the graph? Then perhaps you could also either serialize your documents directly to node properties. Or even better represent them in the graph - graph databases are a superset of document databases anyway. (document being described aggregate root node and its tree of dependend nodes or a dynamic document which is defined with a traversal - see the neo4j spatial dynamic layers) Other people use graph databases for document centric applications and engines too (e.g. the structr CMS on Neo4j)

0

精彩评论

暂无评论...
验证码 换一张
取 消