在MongoDB中存储大型XML [英] Storing large XML in MongoDB

查看:76
本文介绍了在MongoDB中存储大型XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的xml(大小超过10mb,并且包含40多个元素).当前,我们将此类xml存储在Oracle db中,并使用xquery查询和检索xml的一部分.这个过程很慢,需要很多数据库调用.我们正在探索mongodb来存储此xml并对其进行查询. 我只是将xml转换为json并加载到mongo集合中,然后将大量的json数据存储在闪存中.并将xml节点存储为嵌套文档.但是,当我查询(使用find)最里面的元素时,它总是返回整个文档,其中也包含具有不匹配元素值的节点.我希望只有少数几个节点与给定的节点值相匹配. 让我知道是否有最佳方法将此类大型xml文件存储在mongo db中.另外,让我知道如何检索具有查询中指定的确切值的内部节点.预先感谢.

I have a pretty huge xml (>10mb in size & 40+ elements). Currently we store such xml in Oracle db and use xquery to query and retrieve parts of the xml. This process is slow and takes many db calls. We are exploring mongodb to store this xml and query it. I justed converted the xml to json and loaded into a mongo collection and it stored the huge json data in a flash. And it stores the xml nodes as nested docs. But when I query (using find) for a inner most element, it always returns the whole doc, containing nodes with non-matching element values also. I expect only few nodes that matches the given node value. Let me know if there is any best way to store such large xml files in mongo db. And also let me know how to retrieve the inner nodes having exact values specified in the query. Thanks in advance.

推荐答案

您是否考虑过尝试使用最新的XML数据库,例如BaseX(http://basex.org)?这样做可能会给您带来更好的结果,特别是如果您以前曾经使用过XQuery的话.

Have you thought about trying an up-to-date XML Database, such as BaseX (http://basex.org)? It might give you much better results, in particular if you have used XQuery before anyway.

这篇关于在MongoDB中存储大型XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆