title: Mongodb - which data type for events
body: <p>I am a Mongo DB beginner.</p>
  
  <p>I have to create a collection that can store events. All the documents in the Event will  have a FROM_TIME and TO_TIME keys whose values can vary as follows :</p>
  
  <ol>
  <li>{FROM_TIME : "September 1,1939", TO_TIME : "August 1945"}</li>
  <li>{FROM_TIME : "August 15,1947", TO_TIME : "August 15,1947"}</li>
  <li>{FROM_TIME : "1857", TO_TIME : "1858"}</li>
  <li>{FROM_TIME : "December 7,1944 11:00", TO_TIME : "December 7,1944 14:40"}</li>
  <li>{FROM_TIME : "January 1971", TO_TIME : "November 1972"}</li>
  </ol>
  
  <p>Given the random occurrence of the FROM_TIME and TO_TIME, will it be possible to query for events like :</p>
  
  <ol>
  <li>List of events in the second half of the 19th century</li>
  <li>List of events on August 15
  and so on.</li>
  </ol>
  
  <p>I request people here to provide leads in case I need to rethink the structure of my collection as I'm quite naive at Mongo(or any other non-relational)DB.</p>
  
  <p>*<em>*</em>*1st Edit begins here</p>
  
  <p>I wrote the following code:</p>
  
  <pre><code>DBObject dbObject = new BasicDBObject();
  
          dbObject.put("EVNTATMC_ID", new ObjectId());
          dbObject.put("EVNTATMC_DESC", "Pearl Harbour");
          dbObject.put("EVNTATMC_FROM_TIME", Date.valueOf("1944-12-07"));
          dbObject.put("EVNTATMC_TO_TIME", Date.valueOf("1944-12-07"));
          dbObject.put("EVNTATMC_EVNTCMPD_ID", new ObjectId());
          dbObject.put("EVNTATMC_MTRL_ID", null);
          // dbObject.put("EVNTATMC_AUDIT", 1);
          dbObject.put("EVNTATMC_REMARKS", "First insert");
  
          eventAtomic.insert(dbObject);
  dbObject = new BasicDBObject();
  
          dbObject.put("EVNTATMC_ID", new ObjectId());
          dbObject.put("EVNTATMC_DESC", "1857 Revolt");
          dbObject.put("EVNTATMC_FROM_TIME", "1857");
          dbObject.put("EVNTATMC_TO_TIME", "1858");
          dbObject.put("EVNTATMC_EVNTCMPD_ID", new ObjectId());
          dbObject.put("EVNTATMC_MTRL_ID", null);
          // dbObject.put("EVNTATMC_AUDIT", 1);
          dbObject.put("EVNTATMC_REMARKS", "Only years");
  
          eventAtomic.insert(dbObject);
  </code></pre>
  
  <p>Here, I dumbly used String to store incomplete dates but how should I store just an year like 1992, 2001, 2012 or just a month like January, September or something like August 2010 ? I'm not sure as to whether I'm expecting the correct thing ! Please guide me as to how I must handle such 'incomplete' timings.</p>
  
  <p>*<em>*</em>*1st Edit ends here</p>