Sha256: a82ccc7d183d7a09e6d16cc8181718728582635d08407daaa6665829171b65bb

Contents?: true

Size: 768 Bytes

Versions: 6

Compression:

Stored size: 768 Bytes

Contents

const mongoose = require('mongoose');
const { DataElementSchema } = require('./basetypes/DataElement');
const Code = require('./basetypes/Code');
const Interval = require('./basetypes/Interval');
const Quantity = require('./basetypes/Quantity');
const DateTime = require('./basetypes/DateTime');
const Any = require('./basetypes/Any');

const [Number, String] = [
  mongoose.Schema.Types.Number,
  mongoose.Schema.Types.String,
];

const <%= datatype -%>Schema = DataElementSchema({
  <%- for attribute in attrs_with_extras -%>
  <%= attribute[:name] %>: <%= TYPE_LOOKUP_JS[attribute[:type]] -%>,
  <%- end %>
});

module.exports.<%= datatype %>Schema = <%= datatype %>Schema;
module.exports.<%= datatype %> = mongoose.model('<%= datatype %>', <%= datatype %>Schema);

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cqm-models-0.8.0 templates/mongoose_template.js.erb
cqm-models-0.7.7 templates/mongoose_template.js.erb
cqm-models-0.7.6 templates/mongoose_template.js.erb
cqm-models-0.7.5 templates/mongoose_template.js.erb
cqm-models-0.7.4 templates/mongoose_template.js.erb
cqm-models-0.7.3 templates/mongoose_template.js.erb