I have JSONs (Fields: Thread, authors, child count) stored in mongodb with string attributes (basically names of threads crawled from a forum) also having characters like,
'\n', '!' etc.
The "Thread" field has entries like the following:
"Thread": "\n````1111Hellow What is you name----....."
the command is:
collection.distinct(Thread)
The command on such attributes but failed. Will Map reduce work any better on such strings? Or is there another solution?
I attempted to reproduce this issue, but was unable to. I am using pymongo version 2.0.1, and Mongo version 2.1.1-pre. Here is what I tried in iPython:
One possible issue is that the “distinct” method requires a string as an input. The documentation on the distinct command may be found here:
“http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct”
If this is not the cause of your issue, can you please print the steps that you took to generate the error, as well as the error message itself? Additionally, which versions of Mongo and pyMongo are you using?
Thanks.