There isn't any way to replace documents fully with MongoInsertStorage
right now, but it's on the roadmap for mongo-hadoop 2.0: https://jira.mongodb.org/browse/HADOOP-263. Once this is complete, you'll
be able to do replacements using MongoUpdateStorage (and you won't have to
specify all the fields with $set). If you add yourself as a "watcher" to
HADOOP-263, you'll be notified as progress is made on the issue.
On Tuesday, April 26, 2016 at 5:35:08 AM UTC-7, Loïc MATHIEU wrote:
I use MongoInsertStorage with Pig, it's very easy to use and efficient to
export an HDFS file to a MongoDB collection. I specify a custom _id filed,
so when I re-export my HDFS file, if the document already exist it failed.
I don't see how I can specify MongoInsertStorage to make an upsert if the
document already exist, this will be very convenient because I don't want
to drop the collection before re-exporting it (this will empty it and my
service reading the collection will be unavailable during the re-export).
I know that there is a MongoUpdateStorage but it's not as easy to use as
MongoInsertStorage, I have 150 fields in my HDFS files so adding all these
fields in the $set query is not very convenient and each time we will add a
new field in the HDFS file we will need to update the MongoUpdateStorage
You received this message because you are subscribed to the Google Groups "mongodb-user"