I'm trying to get just one field back for all my documents.
I'm new to mongoDB but I can't understand why this isn't working.
var docs = db.collection("articles").find({}, { _id: 0, title:1}).asArray();
I have this query which returns ALL fields, despite putting in the projection of wanting only the title field. The query runs without any errors. Maybe I'm missing something very obvious and need a second pair of eyes to spot it.
Any help is appreciated!
Note: I'm using the mongoDB Atlas' Stitch API.