title: Mongoose - flexible field
body: <p>I am new to NOSQL and MongoDB, I am building an app with NodeJS and Mongoose, and I am building a mongoose schema for a new collection. </p>
  
  <p>The documents of this collection will have some standard fields (id, creation date, user etc...) but then I need to store other stuff, which is a "data" field which will have to contain different data depending on the document. The value will sometimes be simple text and other times it will have lots of key/values pairs. </p>
  
  <p>I am wondering what would be the best solution for this kind of storing needs :</p>
  
  <p>-Create only one "data" field with a String type and then put different types of data into it (text for simple values, stringified objects for more complex data)</p>
  
  <p>-Create in the model all the possible fields that my "more complex data" could have and use only the ones I need in each document</p>
  
  <p>-Something else</p>
  
  <p>What is the best practice for this kind of thing ?</p>