MongoDB array predicates?

I suggest a little another schema: { image = "cab" tags = { name: "NNP", order: 0 }, { name: "NN", order: 1 } } There are three reasons why I am suggest another schema: First it's because two level nesting usual harder to query/update Array within tags array containts items of different types(int, string) Array within tags array looks like for me as 'tag object' with two fields With above schema you can easy query for tags with some name and order: db.images. Find({ "tags. Name" : "NN", "tags.

Order" : 1 }) Update: Dot notation documentation Hope this help!

I suggest a little another schema: { image = "cab" tags = { name: "NNP", order: 0 }, { name: "NN", order: 1 } } There are three reasons why I am suggest another schema: First it's because two level nesting usual harder to query/update Array within tags array containts items of different types(int, string). Array within tags array looks like for me as 'tag object' with two fields With above schema you can easy query for tags with some name and order: db.images. Find({ "tags.Name" : "NN", "tags.

Order" : 1 }) Update: Dot notation documentation Hope this help!

Thanks. I suspected as much. Your query did not work right away though, as tags is still an array of objects, but issuing a .

Find({"tags": {$elemMatch: {"tag":"NN"}}}) did the trick just fine with your schema. – Manny Apr 6 at 9:14 @Manny: All okay with my query ;). .

Find({"tags": {$elemMatch: {"tag":"NN"}}}) give the same result as . Find({"tags. Tag": "NN").

Just take look at documentation or ask if need. Also i've added link to 'dot notation' documentation in my answer. – Andrew Orsich Apr 6 at 9:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions