Discussion:
[mongodb-dev] MONGODB QUERY
Glenn Karl Guiyab
2018-02-12 10:07:50 UTC
Permalink
I have this schema


"db_order" :{
"_id" : "",
"order_code" : "",
"rec_timestamp" : "",
"order_status" : "",
"order_cost" : "",
"order_content" : [
{
"employee" : "",
"food_list" : [],
"total_price": ""
}
]
},

how can I access the data inside the order content? for example I have two
dictionaries inside the order_content. I have this input and pseudo code:
Input :
order_code
employee
food

1. Check for records where order code is and assign it to record 1
2. Check if record1 != None
3. Iterate each dictionary inside the content. Check if record1's record
content.employee has the employee input.
4.If step3 = True: Push input food to the record inside chosen record
inside the order_content.

Man Im stuck with this all day. Hope you can help me.
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/265097c3-be64-4c3b-86d4-f882ee30126d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...