MongoMapper - Mongo::OperationFailure - Database command 'update' failed: BSON field 'update.multi' is an unknown field

1.9k Views Asked by At

I am getting Mongo::OperationFailure - Database command 'update' failed: BSON field 'update.multi' is an unknown field. error on MongoMapper set method.

eg: Metadata.set({:cid => 123}, :brand => "b1")

REF: http://mongomapper.com/documentation/plugins/modifiers.html

I am using following environment:
- Ruby 2.2.0
- Rails 3.2.22
- Gem MongoMapper 0.14.0
- MongoDB 3.6.0

[EDIT]

I am also getting it on insert with error Mongo::OperationFailure: Database command 'insert' failed: BSON field 'insert.w' is an unknown field.

MongoMapper Query

2

There are 2 best solutions below

0
user2932688 On

Had the same exact error, was fighting for a while. solved by using mongo 3.2 - inside of docker container, because wasn't able to start it localy... something like this eventually worked for me docker run -it -p 27017:27017 mongo:3.2 bash

0
avillagran On

I had the same problem, in my case the problem was on the connection:

logger = Logger.new(STDOUT)
mongo_connection = Mongo::Connection.new '127.0.0.1', 27017, logger: logger

The 'logger:' option was missing.