DBA

Deleting Records in Nested BSON Array from MongoDB

When you are trying to manipulate data within nested BSON array in MongoDB, things get complex. Luckily, MongoDB has the ability to pass a JavaScript-like function to forEach to manipulate or query data. Let’s take a look at the data below. Sample Data { “_id”: ObjectId(“5a2f38458bcodgerce87vds”), “customerId”: “45632”, “cart”: { …