Import csv contains Array data

2,456 views
Skip to first unread message

shams

unread,
Jul 19, 2011, 11:29:04 AM7/19/11
to mongodb-user
I have imported the csv data into mongodb. CSV data contains columns
which is in array type values like ['test','test2'].
After the insert into mongodb, it displays like [\'test','test2'\]
using the db.<collectionname>find(). I could not query based on the
array values even when I give the exact match. It returns 0 items.

Any help on this would be appreciated.

Spencer Brody

unread,
Jul 19, 2011, 3:04:30 PM7/19/11
to mongod...@googlegroups.com
Importing CSVs does not handle complex types like arrays, it is designed to import simple, flat data.  The only types that are currently supported are strings and numbers.  In order to import complex types you need to use JSON.

-Spencer


--
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.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Reply all
Reply to author
Forward
0 new messages