I am using angular-8 on the front-end and Rails(5.2) on backend with Mongoid(6.1).
I have a multi-level nested form for model Event
that accepts_nested_attributes_for Ticket
that in turn accepts_nested_attributes_for Channel
.
Whenever I try to update any event and add new Channel
to any Ticket
with in event. I receive this error:
Mongo::Error::OperationFailure (Unknown modifier: $pushAll. Expected a valid update modifier or pipeline-style update specified as an array (9)):
I have looked it up and found here, that $pushAll support is deprecated now and we have to Turn on UsePushEach by default.
But I can't figure out where should I configure this UsePushEach by default settings in Rails.
Any help would be appreciated. Thanks!
Note that you're referring to the Github issue of Mongoose which is a node ODM and you're trying to apply their setup to Rails. They are quite different and their issues and solutions do not apply to each other.
In Mongoid, pushAll were removed since Mongoid 6.3 (see MONGOID-4499). You're seeing this error because you're using an old version of Mongoid.
Upgrading to the latest Mongoid (currently 7.0) should remove this error.