Mongodb - regex match of keys for subobjects -
I have some documents saved in the archive (such as Mongo CLI, is it possible to see sub-topics of I was thinking something like this: But this 0 result is returning. Any help or suggestion would be great. Thank you, Matt document like this It is not possible to ask about the keys. You can search for exact matches using I think (maybe wrongly) you are trying to find documents is a URL sub-document, and that it will not be in all the documents? Why not, push that type of information under one level, something like this: Then you can query this way: If I did not know that I should not use dots ( urls ) which look like this:
{payload: {url_google.com: {url: 'google.com', text: 'search'}}}, {payload: {url_t.co: {url: 't. Co ', text:' url shortener '}}}, {payload: {url_facebook.com: {url:' facebook.com ', text:' social network '}}}
payload ? That match
/ ^ url _ / ? And, if it is possible, then will it be possible to question the match subobabic (for example, make sure that
text exists)?
db.urls.find ({"payload": {"$ regex": / ^ url _ /}} ). Count ();
$ exists , but you can not find names that match a pattern.
{payload: {type: "url", url: "Facebook.com", ...}}
db.foo.find ({"payload.type": "url", .. }}
. ), it is possible to create such documents in some cases, But this will be a cause of great confusion because you have embedded documents (where the dot dot "Path tries to ask questions dot is) to speak as separator".
Comments
Post a Comment