开发者

Suitability of MongoDB for equivalent of XPath

开发者 https://www.devze.com 2023-03-14 18:01 出处:网络
I am very interested in using MongoDB for a variety of reasons. It suits many of my needs well. However, I also need to perform the equivalent of an XPath query. I have a complex hierarchical documen

I am very interested in using MongoDB for a variety of reasons. It suits many of my needs well.

However, I also need to perform the equivalent of an XPath query. I have a complex hierarchical document. I need to be able to extract specific nodes (and their children) based on parameter matching. Something like:

Give me the开发者_运维技巧 document structure starting at node x where the attribute "level" is null or 1.

Can MongoDB do this and if so, how can I go about it? Or should I stick to PostgreSQL / SQL Server for this type of work?


Wrong tool....use a database providing explicit support for hierarchical data like a graph database or a RDBMS with support for XML (if you are using XML). MongoDB is not suited for this purpose..

0

精彩评论

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