MongoDB aggregation query in RapidMiner - mongodb

How to do an aggregation query in MongoDB from the RapidMiner using the mongodb plugin? I've tried to google around, unfortunately with no success at all. It has a direct support for criteria and projection (using operator "Read MongoDB"), however I don't see anyhow support for the aggregation. It does have an "Execute MongoDB Command" operator, which might be capable of doing that but I can't find any extensive examples on how to use it. Eventually, if the above mentioned is not possible, do you know any other way how to do the "unwind" over the data in the RapidMiner having the mongodb collection loaded in?

The Execute MongoDB Command Operator is a wrapper for the mongoDB command db.runCommand(). If you want to continue working in RapidMiner, you can expand the collection you get as a result from the Read MongoDB and transform it into an ExampleSet with the JSON to Data Operator.

Related

Which one is good mongodb aggregate or mongodb functions

Which one is good mongodb aggregate or mongodb functions
what i mean to say : mongodb aggregation or mongodb functional which one is preforable and which one gives good performance.
Mongodb functions
Defines a custom aggregation function or expression in JavaScript.
Whereas aggregation is a prebuilt supported operations.
Executing JavaScript inside an aggregation expression may decrease performance. Only use the $function operator if the provided pipeline operators cannot fulfill your application's needs.
If you have a logic which needs to be customised not supported out of the box, go for functions.
Reference

How does MongoDB Compass Schema Analyze work?

How would you recreate its result? Does it use aggregation only? Or with some code?
Aggregation pipeline operators like objectToArray doesn't work with nested key-value. The next easiest way I can think of when dealing with nested key-value is just using the programming language, in my case JavaScript.
What do I have to do in order to get the same result as "analyze" result from "MongoDB Compass > Schema"?

is there and MongoDB GUI tool where we can create Aggregation queries online

I have seen NoSQLBooster but this only supports "find" function in its visual query builder.
Is there and mongodb tool where we can use aggregation pipeline functions and functions like "set" "findandmodify" visually ?
eventually i want to generate mongoddb c# code.
can we select properties and what we want and it could generate queries and c# code like
var update = Builders<xxxx>.Update.Set(xxxx, xxxxx);
await collection.UpdateManyAsync(filter, update);
Check out MongoDB Compass. It has an aggregation pipeline builder.
https://www.mongodb.com/products/compass
Compass will export the pipeline query to C#, as well as Java, Python, and Node.

Using MapReduce as a Stage in Mongo DB Aggregation Pipeline

I want to use Mongo DB MapReduce functionality along with Aggregation Query.
The below are the stages which I see could be part of the Aggregation pipeline.
Filter docs for which the user has access based on content in the docs and
passed security context(roles of the user)
(Using $REDACT)
Filter based on one or more criteria (Using MATCH)
Tokenize the words in returned docs based on above filtering and populate a
collection (Using MAPREDUCE) (OR) return the docs inline
Query the populated collection/returned docs inline for words based on user
criteria using like query(REGEX) and return the words along with their
locations
I able to achieve steps 1,2 and 4 in the aggregation pipeline.
I am able to achieve Stage 3, separately by using mapreduce functionality in Mongo DB.
I want to make the mapreduce operation also as a stage in the aggregation pipeline and use it to receive the filtered docs from the earlier steps and pass the processed result to next step.
The mapreduce operation is based on sample map and reduce operation. I intend to use the map , reduce and finalize functions as shared in the below stackoverflow issue.
Implement auto-complete feature using MongoDB search
My query is I do now know if we can have MapReduce operation as part of the Mongo DB aggregation pipeline and if so can we use as inline and pass it to the next stage.
I am using Spring Data Mongo DB to implement the Mongo DB aggregation solution.
If someone has implemented the same please help me on this.

MongoDB and PartialFilterExpression capabilities

MongoDB 3.2 is now providing a filter expression to partially index the collection.
Based on that feature, I wonder how MongoDB could help me for the following case.
I do have many pre defined queries very near the filter expression. The principle will be to create many filter expression index.
The index will in fact keep the ids of the maching document and will be updated on each document changes.
For performance reason, I prefer to use the index engine from MongoDB that trying to use an external tools with Trigger solution.
How could I accomplish such feature by extending MongoDB. Any others noSQL could help ?
Thanks