From 0df802c6aa0d301d6a40de2ff8ca62e0b274dcba Mon Sep 17 00:00:00 2001 From: Meg528 <71841959+Meg528@users.noreply.github.com> Date: Wed, 12 Feb 2025 11:30:35 -0700 Subject: [PATCH] Update 6-writing-long-pipelines.mdx --- docs/30-simple-queries/6-writing-long-pipelines.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/30-simple-queries/6-writing-long-pipelines.mdx b/docs/30-simple-queries/6-writing-long-pipelines.mdx index 9109d41..3fe4a1f 100644 --- a/docs/30-simple-queries/6-writing-long-pipelines.mdx +++ b/docs/30-simple-queries/6-writing-long-pipelines.mdx @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem'; Extra activity! Do it if you have extra time or are following along at home. It won't be covered during the hands-on lab. ::: -Aggregation pipelines can get very long, depending on how many stages we need to run. Writing a pipeline is writing code, as you will write it using one of the many MongoDB drivers in your own language. Here we're presenting the examples using JavaScript suitable for the MongoDB shell [mongosh](https://www.mongodb.com/docs/mongodb-shell/), but if you are writing a microservice in Rust, you'll definitely write your pipelines in Rust. +Aggregation pipelines can get very long, depending on how many stages we need to run. Writing a pipeline is writing code, as you will write it using one of the many MongoDB drivers in your own language. Here, we're presenting the examples using JavaScript suitable for the MongoDB shell [mongosh](https://www.mongodb.com/docs/mongodb-shell/), but if you are writing a microservice in Rust, you'll definitely write your pipelines in Rust. :::danger The following syntax doesn't work in the Atlas UI aggregations editor. The editor doesn't support declaring variables. You can try this using the built-in MongoDB Shell in [MongoDB Compass](https://www.mongodb.com/products/tools/compass). @@ -28,7 +28,7 @@ db.books.aggregate([ { $limit: 15 } ]) ``` -Will be changed into: +This will be changed into: ```js @@ -58,12 +58,12 @@ Write your aggregation pipelines like you'll compose functions in your programmi :::tip -As this is code, we can even add comments (starting with `//`) to our pipelines. Or write functions that take parameters and return a stage. Or unit test our stages. +As this is code, we can even add comments (starting with `//`) to our pipelines, or write functions that take parameters and return a stage, or unit test our stages. ::: -👐 We can also use `$gte` to get the books with 150 pages or more. Check $gte syntax in the [docucumentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) and write an aggregation pipeline to return 15 books from 1985 with more than 150 pages. Show only the `title`, `year`, `totalInventory`, and `available` books (sample doc [here](/docs/simple-queries/project)). +👐 We can also use `$gte` to get the books with 150 pages or more. Check $gte syntax in the [documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) and write an aggregation pipeline to return 15 books from 1985 with more than 150 pages. Show only the `title`, `year`, `totalInventory`, and `available` books (sample doc [here](/docs/simple-queries/project)).
Answer