MongoDB 通过 bson_id 批量查找
我使用 Neo4j 来存储大型数据图,并使用 MongoDB 来存储有关各个节点的详细文档信息。
我需要能够获取图形遍历的结果(有时最多 1000 个 bson_ids)并查询 Mongo 来获取它们。我注意到即使有选择和限制,性能也不是很好。
关于如何使此映射更有效的任何想法?
I'm using Neo4j for a large graph of data, and using MongoDB to store detailed document information about individual nodes.
I need 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是我没有关于快速 mongo 文档检索的建议。也许 $in 运算符有帮助。
您在其他场合也直接查询 mongo 吗?或者您只是查询图表?那么也许您也可以将文档直接序列化到节点属性。或者甚至更好地用图形来表示它们 - 图形数据库无论如何都是文档数据库的超集。 (描述聚合根节点及其依赖节点树的文档或通过遍历定义的动态文档 - 请参阅 neo4j 空间动态层)其他人也将图形数据库用于以文档为中心的应用程序和引擎(例如 structr Neo4j 上的 CMS)
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)