Wordcloud of headlines

28 views
Skip to first unread message

Ezequias Rocha

unread,
Feb 28, 2020, 10:56:54 AM2/28/20
to mongodb-user
Hi everyone

I was trying to retrieve all occurrences of a headline field in my collection but I got only an array of my headlines. Could you tell me if it is possible to get an string of this array?

Below my pipeline:

[{$match: {
  dtNews:{$gt: "2019-10-01"}
}}, {$project: {
  str_title:1
}}, {$group: {
  _id: null,
  tex: {
    $addToSet: "$str_title"
  }
}}]


Ezequias.

Tom Hollander

unread,
Mar 1, 2020, 12:57:25 AM3/1/20
to mongodb-user
Hi Ezequias -

This isn't a direct answer to your question since I don't have full context on your collection - but you may want to check out MongoDB Charts which has a Word Cloud chart type. Even if you want to build a word cloud your own way, you may be able to use the aggregation query generated by Charts.

HTH
Tom

Stennie

unread,
Mar 1, 2020, 9:25:55 PM3/1/20
to mongodb-user
Hi Ezequias,

I see you've also posted this on the new MongoDB Community forum: Word cloud of a field using aggregation.

It would be best to continue any discussion on the MongoDB Community site, which is the replacement for this Google Group.

Thanks,
Stennie

Reply all
Reply to author
Forward
0 new messages