Remove atrributes on documents. Problem!

Dario Cammarano shared this question 4 years ago
Answered

When i edit a document to remove some attributes.

I get "WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })"

Doesn't modify the document.

Best Answer
photo

This is not really a NoSQLBooster bug, and the script returns the response result of the Mongo server. It's the same result as your execution in Mongo Shell.

/9c8205f5d5a206717371dcaa2e134266

And, If you want to remove "lastName" field, you should use $unset operator:

db.xxxx.update({_id:"xxxx"}, {$unset: {lastName:1}})

Replies (1)

photo
1

Do you mean to return the wrong prompt or failed to modify it? If you're reporting a /1f41e bug, please make sure you include steps to reproduce it.


  • NoSQLBooster Version
  • Operating System (Windows/Mac/Ubuntu):
  • Expected Behavior
  • Actual Behavior
  • How to Reproduce
  • Screenshots

photo
1

Hi Qinghai.

NoSQLBooster v5.1.8

Operating System. Windows


For example i have a document.

/4593f6b5f30ca00e3c4fdc6066db88c1

And i remove the lastName.

/88458340bd677a33c1056a57bc3e52cf

When i execute the query. with ctrl + enter. I get

/cca8138817bc04c2f20f7f9bee7a4bd8

It happens always when i want only erease content from the document, and with all documents.


Thanks!!

photo
2

This is not really a NoSQLBooster bug, and the script returns the response result of the Mongo server. It's the same result as your execution in Mongo Shell.

/9c8205f5d5a206717371dcaa2e134266

And, If you want to remove "lastName" field, you should use $unset operator:

db.xxxx.update({_id:"xxxx"}, {$unset: {lastName:1}})

photo
1

Thanks for the Feedback!!!

photo
Leave a Comment
 
Attach a file