Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Mongo } from 'meteor/mongo';
- import SimpleSchema from 'simpl-schema';
- const Restaurants = new Mongo.Collection('Restaurants');
- Restaurants.allow({
- insert: () => false,
- update: () => false,
- remove: () => false,
- });
- Restaurants.deny({
- insert: () => true,
- update: () => true,
- remove: () => true,
- });
- const RestaurantsSchema = new SimpleSchema({
- name: {
- type: String,
- label: 'The name of the restaurant.',
- },
- address: {
- type: Object,
- label: 'The address of the restaurant.',
- },
- 'address.street': {
- type: String,
- label: 'The street address of the restaurant.',
- },
- 'address.suite': {
- type: String,
- label: 'The suite number of the restaurant.',
- optional: true,
- },
- 'address.postalCode': {
- type: String,
- label: 'The suite number of the restaurant.',
- },
- 'address.city': {
- type: String,
- label: 'The city of the restaurant.',
- },
- 'address.state': {
- type: String,
- label: 'The state of the restaurant.',
- },
- 'address.country': {
- type: String,
- label: 'The country of the restaurant.',
- },
- telephone: {
- type: String,
- label: 'The telephone number of the restaurant.',
- },
- fax: {
- type: String,
- label: 'The fax number of the restaurant.',
- optional: true,
- },
- website: {
- type: String,
- label: 'The website of the restaurant.',
- optional: true,
- },
- hours: {
- type: Array,
- label: 'The opening hours of the restaurant.',
- },
- 'hours.$': {
- type: Object,
- label: 'A single day the restaurant is open.',
- },
- 'hours.$.day': {
- type: String,
- label: 'The day of the week the restaurant is open.',
- },
- 'hours.$.from': {
- type: String,
- label: 'The time the restaurant is open from on this day.',
- },
- 'hours.$.to': {
- type: String,
- label: 'The time the restaurant is open until on this day.',
- },
- 'hours.$.closed': {
- type: Boolean,
- label: 'Is the restaurant closed on this day?',
- },
- });
- Restaurants.attachSchema(RestaurantsSchema);
- export default Restaurants;
Add Comment
Please, Sign In to add comment