Subject: [mongodb-user] Re: mongo hadoop 1.5.2 version to
java.lang.IllegalArgumentException: Invalid BSON field name $set Doesn’t it support set operation?
It’s been a while since you posted your question, have you found the answer yet ?
Yes, it should still support $set operation. You should check the content of your variable setObj.
For example, below should work with mongo-hadoop v2.0.2, Spark v2.0, MongoDB Java driver v3.4.x
MongoUpdateWritable test = new MongoUpdateWritable(new BasicDBObject("_id", 123),
new BasicDBObject("$set", new BasicDBObject("foo", "bar")),
true, false, false
And another question I found that the field name can’t contain “.”, which is inherited document use.
See also MongoDB dot-notation
I use Mongo Hadoop to store data in Spark directly.
If you’re utilising mongo-hadoop to read/write to Spark, I would recommend to check out MongoDB Spark Connector (Java) instead. See also Spark Java Guide: Write to MongoDB
You received this message because you are subsc...
ribed to the Google Groups "mongodb-user"
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/90b8cc4c-1260-4ab1-a7f3-c535a459fbd7%40googlegroups.com
For more options, visit https://groups.google.com/d/optout