2014년 12월 29일 월요일

mongo query with GridFS

I have a gridFS collection. I would like to be able export only a subset of the data, as it is very big. I could use mongodump with -q on .files but I couldn't do the same on .chunks, which is even more critical.

What is the best approach ? Copying the collection, dropping the .files not corresponding, then dropping the orphaned .chunks documents and finally dumping these collections ?

I was even looking for some ticket on JIRA,  as a --query which has impact on the dump of both .files and .chunks document would make sense, but couldn't find anything...



Can you write out the query that you would use to select the files that you want to limit the dump to? Could the GridFS collections be changing during the time you'll use to perform the dump?


댓글 없음:

댓글 쓰기