Blame view
imports/api/documents/documents.js
749 Bytes
cac7cbc73
|
1 2 3 |
import { Mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; import { Factory } from 'meteor/dburles:factory'; |
d1f05315d
|
4 |
|
c42d4eeac
|
5 6 |
const Documents = new Mongo.Collection('Documents'); export default Documents; |
f0c912bf1
|
7 |
|
ccf91da0a
|
8 9 10 11 12 13 14 15 16 17 18 |
Documents.allow({ insert: () => false, update: () => false, remove: () => false, }); Documents.deny({ insert: () => true, update: () => true, remove: () => true, }); |
f0c912bf1
|
19 20 21 22 23 |
Documents.schema = new SimpleSchema({ title: { type: String, label: 'The title of the document.', }, |
c42d4eeac
|
24 25 26 27 |
body: { type: String, label: 'The body of the document.', }, |
f0c912bf1
|
28 29 30 31 32 |
}); Documents.attachSchema(Documents.schema); Factory.define('document', Documents, { |
c42d4eeac
|
33 34 |
title: () => 'Factory Title', body: () => 'Factory Body', |
f0c912bf1
|
35 |
}); |