I have following list in mongodb.
> db.article.find().pretty()
{
"_id" : ObjectId("5bebcfbb1b48d9974aac78ee"),
"no" : 40,
"subject" : "string",
"content" : "string",
"userid" : "string",
"comments" : [
{
"no" : 1,
"content" : "First content",
"userid" : "john",
"parent" : null,
"seq" : 12,
"created_at" : ISODate("2018-11-14T16:33:01.943Z")
},
{
"no" : 2,
"content" : "Second",
"userid" : "doe",
"parent" : null,
"seq" : 25,
"created_at" : ISODate("2018-11-14T16:33:01.943Z")
},
}
Now I'm using mongoengine
in my python app.
If I want to get comments's no: 2's seq
field value(in this code, it is 25), how can I manipulate my query?
I found the docs related it(http://docs.mongoengine.org/guide/querying.html) But I don't know it is exactly same with what I want.
Any solution here?
Thanks!