These are chat archives for Automattic/mongoose

19th
Dec 2017
Karthi
@Karthi-SRV
Dec 19 2017 06:35
Convert the query into node. In which version arrayfilter work in mongoose or how can run these in node app
db.getCollection('students').update(
    { 
        "_id": ObjectId('5a377d62d21a3025a3c3aa49')
    },
    {
        $set: {
            "examples.$[i].isDeleted": true,
            "examples.$[i].updatedAt": new Date(),
            "updatedAt": new Date()
        }
    },
    {
        arrayFilters: [
            {
                "i._id": { 
                    $in:[
                        ObjectId("5a377d62d21a3025a3c3aa4d"),
                        ObjectId("5a377d62d21a3025a3c3aa4c")
                    ]
                }
            }
        ],
        multi: true
    }
)
Kannan T
@kannan007
Dec 19 2017 09:17
use mongoose