0

I am trying to delete a column from every document of the mongodb. i am able to do it using the mongodb command but for the same in the UAT. i cannot use that command as we can access through only by restheart. Can you help with same with restheart.

i make the call using Postman.

db.CommodityActuals.update({"commodityValue" :{$exists: true}},{$unset:{"commodityValue":1}},{multi: true});

Thanks & Regards, Jagadeesh Pavan.

Jagadeesh
  • 31
  • 5

1 Answers1

0

You can PATCH the document using the $unset update operator to remove the array property.

If you need just to remove an element of the array you can use the array update operators such as $pop.

It should be something like:

PATCH /db/coll/id { "$unset" : { "array" : true} }

Andrea Di Cesare
  • 1,125
  • 6
  • 11