Hi Guarav,
Instead of replying to very old discussions, please start a new discussion topic for your question.
FYI, as per Bernie's comment on the original discussion re: GridFS, you can save multiple versions with the same filename to GridFS and they will have unique _ids assigned. The Python driver has get_version() and get_last_version() helpers for this, but you can do similar queries in any driver finding by filename and sorting by _id (or uploadDate).
Example of multiple versions of "test.osa" in the mongo shell:
db.fs.files.find({filename:'test.osa'}).sort({_id: -1})
{
"_id" : ObjectId("53b3902c4564b25dc2bd6f9a"),
"filename" : "test.osa",
"chunkSize" : 261120,
"uploadDate" : ISODate("2014-07-02T04:53:00.269Z"),
"md5" : "cab7cedd24b0a255f9a747d4e8dbae6c",
"length" : 59
}
{
"_id" : ObjectId("53b3902b750d22b54053c795"),
"filename" : "test.osa",
"chunkSize" : 261120,
"uploadDate" : ISODate("2014-07-02T04:52:59.521Z"),
"md5" : "cab7cedd24b0a255f9a747d4e8dbae6c",
"length" : 59
}
If you have further questions, let's continue on a new discussion thread :).
Thanks,
Stephen