Guest User

Untitled

a guest
Mar 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var mongoose = require('mongoose');
  2. var locCoordSchema = require.main.require('./models/locCoordSchema.js').shema;
  3. var mySchema= new Schema({
  4. coordinate:{type:locCoordSchema,default:null}
  5. });
  6.  
  7. var mongoose = require('mongoose');
  8. var Schema = mongoose.Schema;
  9. var locCoordSchema = new Schema({
  10. 'type': { type: String, enum: ['Point', 'LineString', 'Polygon'], default: 'Point' },
  11. coordinates: { type: [Number], default: [0, 0] }
  12. });
  13. module.exports = mongoose.model('locCoordSchema', locCoordSchema);
Add Comment
Please, Sign In to add comment