MongoDB - basic data design

I have a list of Google map markers that I'm associating images with. Each marker can have multiple images\video's and each image can be thumbnailed to multiple sizes.

  • eg. I have markerID 555
  • I'm storing the images in GridFS and add MarkerID and Thumbnail Size as MetaData properties.

To get a list of images for a given marker I simply search the fs.files collection as follows.

{"metadata.size": imageSize, "metadata.markerID": markerID }

Is there anything wrong with this approach?

As long as you have index on the search criteria and enough RAM to hold all the index in memory, you should be ok with that. Please note that in your example above, you need a compound index, see Mongo Docs for more information about mongo indexes.