-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Performance, Querying, Sharding, Write Ops
-
None
-
Environment:Linux, Mongo 2.0.6, 3 shards (each in replica set with 2 machines and 1 arbiter)
-
Query
I can not find similar mysql syntax "INSERT ... SELECT ..." in mongo for sharded collection.
db.eval() - does not work on sharded collection
MapReduce - too expensive and slow operation
Use case:
Need select documents from one sharded collection, make rearrangement of fields and upsert it to another sharded collection.
Source collection format:
{
"_id": ObjectId("4fcf7349d144ad591c016534"),
"sid": 111,
"uh": "www.site.kz",
"cid": "4facd5427701a",
"ses": "4fcf7278f1f19",
"ip": NumberInt(1597732605),
"t": ISODate("2012-06-06T15: 08: 40.0Z"),
...
}
Destination collection format:
{
"_id":
,
"t": ISODate("2012-06-06T15: 08: 40.0Z"),
}
- depends on
-
SERVER-18027 Support aggregation $out to sharded collection
- Closed
-
SERVER-12280 allow $out to append to/merge with existing collection instead of replacing it
- Closed
- duplicates
-
SERVER-18027 Support aggregation $out to sharded collection
- Closed