index.js 596 B

123456789101112131415161718192021222324252627
  1. // modules
  2. var mongoose = require('../../../lib');
  3. var Schema = mongoose.Schema;
  4. // parse json
  5. var raw = require('./schema.json');
  6. // create a schema
  7. var timeSignatureSchema = Schema(raw);
  8. // compile the model
  9. var TimeSignature = mongoose.model('TimeSignatures', timeSignatureSchema);
  10. // create a TimeSignature document
  11. var threeFour = new TimeSignature({
  12. count: 3,
  13. unit: 4,
  14. description: '3/4',
  15. additive: false,
  16. created: new Date,
  17. links: ['http://en.wikipedia.org/wiki/Time_signature'],
  18. user_id: '518d31a0ef32bbfa853a9814'
  19. });
  20. // print its description
  21. console.log(threeFour);