That should work just fine. Can you check the values you are using and
make sure they are what you expect? Or if you can provide a sample
showing the problem that would help.
On Mon, Aug 27, 2012 at 9:41 AM, Sezgin Riggs <
sez...@gmail.com> wrote:
> I'm trying to crawl the web and store HTML data on MongoDB using Java.
> Unfortunetely while storing data, MongoDB drivers nulling the data and
> stores empty field for HTML data.
>
> When I get the first 500 (or 1000) chars of HTML data, I can store/
> upsert it without a problem so I think something in HTML (or
> Javascript in it) corrupts the command sent to MongoDB and MongoDB
> stores empty data instead of HTML. Should I use something else
> (escaping string? I saw there was a class for that in former driver
> versions) for storing HTML/JavaScript data?
>
> Here is my code snippet
>
> BasicDBObject savedDoc = new BasicDBObject();
> savedDoc.put("url_ID", objURL.get("_id"));
> savedDoc.put("cnt", content); //Content field
> savedDoc.put("st", 0);
> collection.update(new BasicDBObject().append("url_ID",
> objURL.get("_id")), savedDoc, true, false);
>
>
> BTW: I'm using 2.8.0 drivers for Java...
>
>
> Best Regards,
> Sezgin
>
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to
mongod...@googlegroups.com
> To unsubscribe from this group, send email to
>
mongodb-user...@googlegroups.com
> See also the IRC channel --
freenode.net#mongodb