Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNate Baker
17,247 PointsWhen trying to run db.posts.update, receive error.
When I try to run db.posts.update as shown in video, I receive following error message:
"errmsg": ">1 field in obj: { tags: [ \"foo\", \"bar\", \"interesting\" ], title: \"I'm an Updated Title!\" }"
Here's my statement:
db.posts.find({author: ObjectId("5a3201ab48e2b371eafe230f")}, {$set: {tags: ['foo', 'bar', 'interesting'], title: "I'm an Updated Title!"}})
Nate Baker
17,247 PointsAaaaand...that was the issue. I notice the longer I go at this, the more tired I get and miss stupid stuff like that.
Thanks, Dave.
Dave StSomeWhere
19,870 PointsDave StSomeWhere
19,870 PointsThat looks like a .find statement. What does your .update statement look like?