Grokking MongoDB
Vote

0% completed

​

String Expression Operators

A string expression reads a string from each document and calculates a new value from it, such as a trimmed copy, a length, or a part of the text. It runs inside aggregate(), and not in a plain query filter where $regex and $text run. In the examples here, the stored documents do not change, and only the output shows the new values.

Preparing the Expression Examples

The examples use the same six users as the previous lesson. If you continue from there, the collection is already in place. Otherwise, run this setup, which leaves out the text index because no example here needs it.

`

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content