-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
125 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
website/versioned_docs/version-v1.20/configuration/oplog-support.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
sidebar_position: 4 | ||
slug: /configuration/oplog-support/ | ||
--- | ||
|
||
# OpLog support | ||
|
||
FerretDB currently has a basic implementation of the OpLog (operations log). | ||
|
||
The OpLog is a special capped collection which stores all operations that modify your data. | ||
A capped collection is a fixed-sized collection that overwrites its entries when it reaches its maximum size. | ||
Naturally, OpLog is a capped collection so as to ensure that data does not grow unbounded. | ||
|
||
:::note | ||
At the moment, only basic OpLog tailing is supported. | ||
Replication is not supported yet. | ||
::: | ||
|
||
Oplog support is critical for the Meteor framework to build real-time applications. | ||
Such applications require notifications on real-time events and can use the OpLog to build a simple pub/sub system. | ||
|
||
## Enabling OpLog functionality | ||
|
||
FerretDB will not create the oplog automatically; you must do so manually. | ||
|
||
To enable OpLog functionality, manually create a capped collection named `oplog.rs` in the `local` database. | ||
|
||
```js | ||
// use local | ||
db.createCollection('oplog.rs', { capped: true, size: 536870912 }) | ||
``` | ||
|
||
You may also need to set the replica set name using [`--repl-set-name` flag / `FERRETDB_REPL_SET_NAME` environment variable](flags.md#general). | ||
|
||
:::tip | ||
**`--repl-set-name` flag / `FERRETDB_REPL_SET_NAME`** environment variable allow clients and drivers to perform an initial replication handshake. | ||
We do not perform any replication but clients and drivers will assume that the replication protocol is being used. | ||
The purpose of this flag is to allow access to the OpLOg. | ||
::: | ||
|
||
```sh | ||
docker run -e FERRETDB_REPL_SET_NAME=rs0 ... | ||
``` | ||
|
||
To query the OpLog: | ||
|
||
```js | ||
db.oplog.rs.find() | ||
``` | ||
|
||
To query OpLog for all the operations in a particular namespace (`test.foo`), run: | ||
|
||
```js | ||
db.oplog.rs.find({ ns: 'test.foo' }) | ||
``` | ||
|
||
If something does not work correctly or you have any question on the OpLog functionality, [please inform us here](https://github.com/FerretDB/FerretDB/issues/new?assignees=ferretdb-bot&labels=code%2Fbug%2Cnot+ready&projects=&template=bug.yml). |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[ | ||
"v1.20", | ||
"v1.19", | ||
"v1.18", | ||
"v1.17" | ||
"v1.18" | ||
] |