PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 16th of March, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[21:49:35] <rosenjcb> Hey guys, stupid question but when I do a query of a field in an object in an array across multiple documents in a collection, how do I return only that object and its field?
[21:50:30] <rosenjcb> Say I have a collection of forum threads and they contain an array called "replies" and I'm searching for the reply that contains a text I capture via regex.
[21:50:43] <rosenjcb> {"replies.comment_sanitized" : {$regex : "naughty_word"}}
[21:50:59] <rosenjcb> If I run that, I do get the threads that contain at least one post with a naughty word but not that specific post.
[21:51:06] <rosenjcb> post = reply