Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mongodb-php update $pull
- {
- "_id": ObjectId("4f1950f0e902edfc3e000001"),
- "coupons": {
- "4f1950b7e902edf23e000001": {
- "_id": ObjectId("4f1950b7e902edf23e000001"),
- "couponID": ObjectId("4f15c7d8e902edb667000000")
- },
- "4f1950bfe902ed843f000000": {
- "_id": ObjectId("4f1950bfe902ed843f000000"),
- "couponID": ObjectId("4f171f33e902ed4f4f000002")
- }
- },
- "recipients": [
- {
- "email": "test1@gmail.com",
- "get": "?auth=ZG1pdHJ5LnZvbG9zbmloaW5AZ21haWwuY29tfDA5OGY2YmNkNDYyMWQzNzNjYWRlNGU4MzI2MjdiNGY2"
- },
- {
- "email": "test2@gmail.com",
- "get": "?auth=ZGpyb3VibGVAZ21haWwuY29tfDA5OGY2YmNkNDYyMWQzNzNjYWRlNGU4MzI2MjdiNGY2"
- },
- {
- "email": "test3@gmail.com",
- "get": "?auth=a2FsaWJyb3YxQGdtYWlsLmNvbXwwOThmNmJjZDQ2MjFkMzczY2FkZTRlODMyNjI3YjRmNg=="
- }
- ],
- "title": "test"
- }
- $result = $mongoDB->emailDeliveryActive->update(
- array('_id' => $emailDelivery['_id']),
- array(
- '$pull'=>array(
- 'recipients.$.email' => 'test1@gmail.com'
- )
- )
- );
- $result = $mongoDB->emailDeliveryActive->update(
- array('_id' => $emailDelivery['_id']),
- array(
- '$pull'=> array('recipients' => array('email' => 'test1@gmail.com'))
- )
- );
Add Comment
Please, Sign In to add comment