Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "userid": 1234,
- "username": "tester",
- "password": "*****",
- "fullname": "For Test Only",
- "emails" :[
- { "email": "test1@mail.com", "active": true },
- { "email": "test2@mail.com", "active": true }
- ]
- }
- {
- "userid": 1234
- "username": "tester",
- "password": "*****",
- "fullname": "For Test Only",
- "emails" :[
- { "email": "test1@mail.com", "active": false},
- { "email": "test2@mail.com", "active": true }
- ]
- }
- $update_result = $users->update_one(
- { 'userid' => $doc->{'userid'}},
- { '$set' => { 'emails.[0].email.active => false }},
- { 'upsert' => 1}
- );
- {
- "userid": 1234
- "username": "tester",
- "password": "*****",
- "fullname": "For Test Only",
- "emails" :[
- { "active": false},
- { "email": "test2@mail.com", "active": true }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement