Rails app has Moingoid 7.0.5
class Example
include Mongoid::Document
field :name, type: String
end
And when I query Example.not(name: "xyz").count
, I get this error:
Mongo::Error::OperationFailure: $not needs a regex or a document (2)
(on localhost:27017, modern retry, attempt 1) (on localhost:27017,
modern retry, attempt 1)
Mongoid Documentation does say that we can use not
operator this way as well. I do get expected results for Example.where(:name.ne => "xyz").count
.
Is there something in configuration that leads to this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…