query in nosql mongo db : help me

24 views
Skip to first unread message

zuppi...@gmail.com

unread,
Sep 19, 2017, 8:33:30 AM9/19/17
to mongodb-user

good morning ,

how is the syntax for extract from this collection (dictionaries) this fields ("CAT", "AZ" ) from the version 2?


sorry but i don't' know nosql code


{

"_id" : ObjectId("XXX"),

"status" : "active",

"code" : "CAT",

"prototype" : null,

"createdBy" : "YYY",

"modifiedBy" : "AAA",

"creationDate" : ISODate("2017-02-17T12:47:58.353Z"),

"modificationDate" : ISODate("2017-06-01T13:45:10.543Z"),

"version" : 21,

"data" : {

"1" : {

"attributes" : {

"name" : {

"type" : "text",

"code" : "name",

"translatable" : true,

"required" : false,

"unique" : false

}

},

"elements" : {

"AZ" : {

"status" : "active",

"values" : {

"name" : "dictionaries.CAT.values.AZ.name"

},

"code" : "AZ",

"order" : 1

},

"2" : {

"attributes" : {

"name" : {

"type" : "text",

"code" : "name",

"translatable" : true,

"required" : false,

"unique" : false

}

},

"elements" : {

"AZ" : {

"status" : "active",

"values" : {

"name" : "dictionaries.CAT.values.AZ.name"

},

"activationDate" : ISODate("2017-06-01T13:45:10.543Z"),

"activatedBy" : "AAA",

"versionId" : 2,

"comment" : "VVVVVV"

}

},

"latest" : 2

}

Kevin Adistambha

unread,
Sep 27, 2017, 2:33:51 AM9/27/17
to mongodb-user

Hi

Could you be more specific in what you need? I don’t understand what you mean by “CAT”, “AZ”, and “version”. Do you need to retrieve specific fields and their values?

How is this document generated? It appears that you have elements inside elements. Is this intentional?

sorry but i don’t’ know nosql code

You may find the following links helpful:

Please note that MongoDB University also provides free courses on getting started with MongoDB, particularly M101P and M102.

If you’re still having issues, could you post additional details:

  • What is your MongoDB version
  • What you’re trying to achieve
  • What have you tried so far
  • What error message you’ve seen

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages