A simple Ecto custom type for the Postgres tsrange type.
Based on: http://pedroassumpcao.ghost.io/using-postgres-range-data-type-in-ecto/ and elixir-ecto/postgrex#27
A simple Ecto custom type for the Postgres tsrange type.
Based on: http://pedroassumpcao.ghost.io/using-postgres-range-data-type-in-ecto/ and elixir-ecto/postgrex#27
| var mongoose = require('mongoose'); | |
| mongoose.connect('localhost', 'testing_multiTenant'); | |
| /** | |
| * User schema. | |
| */ | |
| var UserSchema = new mongoose.Schema({ | |
| name: String | |
| , prefix: { type: String, required: true } |
| [ | |
| { | |
| "text": "This is the first question", | |
| "options": ["answer1","answer2","answer3","answer4"], | |
| "answer": 2 | |
| }, | |
| { | |
| "text": "This is the second question", | |
| "options": ["answer 1","answer 2","answer 3", "answer 4"], | |
| "answer": 1 |