Skip to content

Commit c70ea17

Browse files
authored
Merge pull request #47652 from khowling/patch-3
Add NOTE do use version 3.6 or above
2 parents 54d7f9b + 577fe44 commit c70ea17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

articles/cosmos-db/mongodb-change-streams.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ms.author: srchi
1313

1414
[Change feed](change-feed.md) support in Azure Cosmos DB’s API for MongoDB is available by using the change streams API. By using the change streams API, your applications can get the changes made to the collection or to the items in a single shard. Later you can take further actions based on the results. Changes to the items in the collection are captured in the order of their modification time and the sort order is guaranteed per shard key.
1515

16+
> [!NOTE]
17+
> To use change streams, create the account with version 3.6 of Azure Cosmos DB's API for MongoDB, or a later version. If you run the change stream examples against an earlier version, you might see the `Unrecognized pipeline stage name: $changeStream` error.
18+
1619
The following example shows how to get change streams on all the items in the collection. This example creates a cursor to watch items when they are inserted, updated, or replaced. The $match stage, $project stage, and fullDocument option are required to get the change streams. Watching for delete operations using change streams is currently not supported. As a workaround, you can add a soft marker on the items that are being deleted. For example, you can add an attribute in the item called "deleted" and set it to "true" and set a TTL on the item, so that you can automatically delete it as well as track it.
1720

1821
```javascript
@@ -69,4 +72,4 @@ The following error codes and messages are supported when using change streams:
6972
## Next steps
7073

7174
* [Use time to live to expire data automatically in Azure Cosmos DB's API for MongoDB](mongodb-time-to-live.md)
72-
* [Indexing in Azure Cosmos DB's API for MongoDB](mongodb-indexing.md)
75+
* [Indexing in Azure Cosmos DB's API for MongoDB](mongodb-indexing.md)

0 commit comments

Comments
 (0)