Comments (3)
@kazzacarrot Here's my code if you want to compare - it passes run and verify. In the official MongoDB Node api notes, remove() has been deprecated in favor of deleteOne() or deleteMany().
var mongo = require('mongodb').MongoClient;
var url = 'mongodb://localhost:27017/'+process.argv[2];
mongo.connect(url, (err, db) => {
if (err) throw err;
var coll = db.collection(process.argv[3]);
var id = process.argv[4];
coll.deleteOne({
_id: id
}, (err, data) => {
if (err) throw err;
db.close();
});
});
from learnyoumongo.
@hwangm, I copy pasted your code and it still shows the same error for me.
Expected document to be removed [ { _id: '554a655c0639034860349353', name: 'blah' } ]
Mongodb version:
MongoDB shell version v3.6.2
git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
OpenSSL version: OpenSSL 1.0.0-fips 29 Mar 2010
allocator: tcmalloc
modules: none
build environment:
distmod: amazon
distarch: x86_64
target_arch: x86_64
P.S.: I am using amazon clod 9 ide.
from learnyoumongo.
@snehal96 Have you looked at the solutions updated for mongodb 3+?
https://github.com/nachoperassi/learnyoumongo
Perhaps there was some change that makes my solution invalid now, I'm not sure since it was a while ago now.
from learnyoumongo.
Related Issues (20)
- Aggregate exercise - why use toArray ? HOT 1
- Ex5: Insert. / Keep getting "AssertionError" HOT 6
- Change documentation resources? HOT 1
- Call for maintainers HOT 4
- Only localhost? HOT 3
- Can't get past the first hurdle HOT 2
- 123
- Irrelevant messages in the instructions of the first two challenges HOT 1
- 2/6 CONNECT instruction not working on Cloud9 HOT 3
- ReferenceError: done is not defined HOT 2
- The aggregate exercise question has mark down that doesn't display well on the terminal
- Insert module needs an additional hint HOT 2
- Official solutions should be updated to MongoDB ^3.0.0 HOT 2
- Solutions updated to MongoDB +3.0.0!
- Error in description of exercises
- Find Project exercise: incorrect example and resource link
- Find exercise: connect callback parameters have changed in current version HOT 8
- Why is my solution to UPDATE not being verified and console.log is not working HOT 1
- Still being maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnyoumongo.