This is my query. I would like to export the output of this query into csv (excel format) so i can have a table of data. How can i do this? I am using Robo3t.
(db.getCollection('sentimentOpinions').aggregate([
{ $match : { objectType : "Security" } },
{ $lookup:{
from: "securities",
localField: "objectId",
foreignField: "id",
as: "StockID" }},
{ $unwind:"$StockID" },
{ $lookup:{
from: "users",
localField: "userId",
foreignField: "userId",
as: "USER_ARJ" }},
{ $unwind:"$USER_ARJ" },
{$project :{USER_ID : "$userId",
NAME : { $concat: [ "$USER_ARJ.profile.firstName",", ",
"$USER_ARJ.profile.lastName" ] },
SECURITY_ID: "$StockID.id",
SECURITY: "$StockID.displayName",
TICKER: "$StockID.symbols.yahoo",
OPINION_VALUE: "$value",
OPINION_DATE: "$opinionDate"}},
{ $sort : { OPINION_DATE : -1 } } ]))