March 2019
Intermediate to advanced
394 pages
11h 4m
English
In document modifier operations, such as update and remove, we have a similar situation to the one we saw with find. If we have the shard key in the find section of the modifier, then mongos can direct the query to the relevant shard.
If we don't have the shard key in the find section, then it will again be a fanout operation.
The following table sums up the operations that we can use with sharding:
|
Type of operation |
Query topology |
|
Insert |
Must have the shard key |
|
Update |
Can have the shard key |
|
Query with shard key |
Targeted operation |
|
Query without shard key |
Scatter-and-gather operation/fan out query |
Read now
Unlock full access