我无法在mongodb版本3.0.12
和ruby gem版本中执行upsert查询1.x
。我使用的是Ruby 1.9.3版本。我尝试将mongodb升级到版本3.2
和3.4
,但仍面临同样的问题。如果任何人有任何想法正在发生或遇到类似问题,请提供一些见解。数据库命令'更新'失败:更新命令的未知选项:upsert
Database command 'update' failed: Unknown option to update command: upsert
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/db.rb:559:in `rescue in command'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/db.rb:555:in `command'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/collection_writer.rb:314:in `block in send_write_command'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/functional/logging.rb:55:in `block in instrument'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/functional/logging.rb:20:in `instrument'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/functional/logging.rb:54:in `instrument'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/collection_writer.rb:313:in `send_write_command'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/collection.rb:1076:in `send_write'
/Users/ayushgaur/.rvm/gems/ruby-1.9.3-p551/bundler/gems/mongo-ruby-driver-de949571b660/lib/mongo/collection.rb:497:in `update'
是不是mongo-ruby-driver版本2.4?你为什么在版本1.x? – eiko
请提供您使用过的实际查询。 –
@eiko项目中有很多相关的宝石,所以我不想最终更新所有宝石。 –