thefonso
thefonso

Reputation: 3390

what is this mongodb line in english

I'm a mongodb noob trying to learn mongodb...

I'm just tying to understand what this line is saying in english...

{ $project : { _id : { $substr : ["$_id",0,1] } } }

can someone translate?

Upvotes: 0

Views: 80

Answers (1)

Mark Reed
Mark Reed

Reputation: 95315

It says that in the response to a query being projected through this expression, the _id field of each object should be replaced by only the first character of its actual value. It's part of the aggregation framework, documented here.

Upvotes: 1

Related Questions