How create a new array field with the aggregate framework
I'm starting to use mongoDb and I'm stuck with a simple use case. Let's say I've got a collection 'aCollection' with entries such as this: { _id: ObjectId(123), lat: 48,56623, long: 2,56332 } and I want to create a new collection with entries like this: { _id: ObjectId(123), lat: 48,56623, long: 2,56332, geometry : { type: "Point", coordinates: [48,56623, 2,56332] } } I thought about the aggregation framework: db.aCollection.aggregate([{$project: { _id: 1, lat: 1, long: 1, geometry: { type: {$concat: ["Point"]}, coordinates: ["$lat", "$long"] } }}]) But it ain't working and I get this