Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to build a system of documents that have hundreds of tags assigned to them, but each document-tag association has a certain condition it has to also meet so the document would be returned:

title: "new document", 
tags: [
    label: "label1", 
    intervals: [
       {start_date: "2012-01-05", end_date: "2013-01-05"},
       {start_date: "2012-01-06", end_date: "2013-01-25"},
    applicable_for: ["birthdays","anniversaries"]
    label: "label2", 
    start_date: "2012-04-05", 
    end_date: "2014-02-05", 
    applicable_for: ["anniversaries"]

A typical search would be something like:

Show me documents tagged with "label1", but only if this tag is applicable for "birthdays" and a certain date interval D0-D1 overlaps with one of the tag's intervals.

I have two questions:

  • can this type of query be performed in MongoDB?
  • is MongoDB the correct choice for this scenario? I've never used it until now, but it sems a better fit than MySQL or SOLR for tens of thousands of documents, each with hundreds of tags.

Thanks in advance!

share|improve this question

1 Answer 1

@mtai, I really wish could help you, but I haven't many experience with mongo in production yet.

But, I think that you try to make this query and see the results if good for you, Now, I'm doing the M101P course See this Link! And them will talk about that only at finishing the course, if you try to do too, it's free!

See too, this link talk about Data Models on MongoDB And this, talk about Use Cases of Mongo...

I hope helped you!! Goodbye

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.