Reputation: 14279
I am interacting with a MongoDB using the module monk
.
Working locally, everything is operating as expected. However, I've pushed the app to Heroku, and something has been changed that is causing errors however I can't ascertain exactly what.
One thing I've noticed is that when I hit a delete endpoint I've created, which maps to the db.collection.remove method, when I hit the endpoint locally I receive a 1
in response from monk.
However, when I hit the API endpoint as it's hosted on Heroku, the response is:
{
"ok": 1,
"n": 1
}
Is monk using a new version of mongoskin
one of its dependencies? I've looked through the modules thinking that may be the case, but haven't been able to determine anything.
What has changed that is causing the db.collection.remove() method to return different values?
Upvotes: 0
Views: 61
Reputation: 3751
Remove method is depreciated if you are using the latest version of mongoskin as it uses version 2 of the mongodb driver underneath. The method has been replaced by deleteOne and deleteMany, see here for more info, also the return value from method is described within the mongodb driver docs
Upvotes: 1