You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.
I have the following query myModel.findOneAndUpdate({_id: ID},{$push: {myField: myData}},{$new: true})
But pre findOneAndUpdate not work and error occur in its integration with schema:
Error: key $push must not start with '$' at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:912:19) at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:348:18) at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:938:17) at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:348:18) at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:728:17) at serializeObject (/app/node_modules/bson/lib/bson/parser/serializer.js:348:18) at serializeInto (/app/node_modules/bson/lib/bson/parser/serializer.js:938:17) at BSON.serialize (/app/node_modules/bson/lib/bson/bson.js:63:28) at Query.toBin (/app/node_modules/mongodb-core/lib/connection/commands.js:143:25) at serializeCommands (/app/node_modules/mongodb-core/lib/connection/pool.js:1045:43) at Pool.write (/app/node_modules/mongodb-core/lib/connection/pool.js:1261:3) at WireProtocol.command (/app/node_modules/mongodb-core/lib/wireprotocol/3_2_support.js:186:12) at executeWrite (/app/node_modules/mongodb-core/lib/wireprotocol/3_2_support.js:301:11) at WireProtocol.insert (/app/node_modules/mongodb-core/lib/wireprotocol/3_2_support.js:18:5) at Server.insert (/app/node_modules/mongodb-core/lib/topologies/server.js:789:35) at Server.insert (/app/node_modules/mongodb/lib/topologies/topology_base.js:321:25)
I have the following query
myModel.findOneAndUpdate({_id: ID},{$push: {myField: myData}},{$new: true})
But
pre findOneAndUpdate
not work and error occur in its integration with schema:Error is in
d.createdBy
, because if I consoled
, it shows following data:{ updatedAt: 2019-01-30T08:52:43.770Z, __v: undefined }
The text was updated successfully, but these errors were encountered: