Home Mongodb .net updating one of the embedded documents
Reply: 0

Mongodb .net updating one of the embedded documents

user4644
1#
user4644 Published in September 19, 2018, 7:04 pm

I have an orders and each has transactions embedded.

{
    _id: orderId1,
    other_fields: something else,
    transactions: [
       {
           _id: someId,
           price: 25,
           status: 1
       },
       {
           _id: someId2,
           price: 30,
           status: 0
       }
    ]
}

Now i want to change the status of one of the transactions(lets say: someId2). How can i do that?

Both orders and transactions are models with transaction as ICollection<Transaction>

Also, is it possible without using any magic string?

share|improve this question

2 Answers 2

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.369631 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO