How to implement $$ROOT
See original GitHub issueHow one could implement $$ROOT variable as in here https://docs.mongodb.com/manual/reference/operator/aggregation/group/#group-documents-by-author?
It’s in mongo since 2.6.
Do ‘custom operators’ fit for this?
I tried to implement it this way, but it doesn’t work.
Mingo.addOperators(Mingo.OP_PIPELINE, function (m) {
return {
$$ROOT: function (obj) {
return obj;
}
}
})
It throws the error: “Invalid operator name ‘$$ROOT’”
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to Implement Root Detection in Android Applications
The goal of comprehensive root detection is to make running the application on a rooted device more difficult. Detecting rooted devices alone are...
Read more >How to root Android phones and tablets (and unroot them)
One of the easiest ways to root an Android device is by using an app, and several rooting apps have garnered attention over...
Read more >How to root Android: Everything you need to know!
The good news is that rooting is much easier than it once was in many cases. In fact, the easiest method is usually...
Read more >How to root your Android smartphone: Google, OnePlus ...
Rooting your phone is still possible — and fun — these days. Here's how to do it on your Android device.
Read more >How to easily root an Android device - CNET
Now you can install KingoRoot. Then run the app, tap One Click Root, and cross your fingers. If all goes well, your device...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have implemented
$redact
on the development branch. Looking good so far and should be out in the next version. With regards to the system variables they can be handled directly within the value resolution functions. I don’t think it is a good idea to allow defining new ones at present.After careful consideration, I still found the ones available to
$redact
more useful though$$ROOT
can be implemented quite easily.$$CURRENT
can also be handled but will require a way to rebind the variable as per the documentation.@zag2art Out of curiousity, what is your use case for requiring
$$ROOT
?Still some more work to do then. My implementation did not handle subpaths for
$$ROOT
.I will make the update in the next minor release. Thanks for the tests.