本文整理汇总了TypeScript中meteor-rxjs.MongoObservable.Collection类的典型用法代码示例。如果您正苦于以下问题:TypeScript MongoObservable.Collection类的具体用法?TypeScript MongoObservable.Collection怎么用?TypeScript MongoObservable.Collection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MongoObservable.Collection类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Action } from '../models/action.model';
export const Activity = new MongoObservable.Collection<Action>('activity', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Activity.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例2: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Todo } from '../models/todo.model';
export const Todos = new MongoObservable.Collection<Todo>('todos', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Todos.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例3: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Entity } from '../models/entity.model';
export const Entities = new MongoObservable.Collection<Entity>('entities', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Entities.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例4: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Version } from '../models/version.model';
export const Versions = new MongoObservable.Collection<Version>('versions', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
Versions.allow({
insert: function (userId, doc) {
return true;
},
update: function (userId, doc) {
return true;
},
remove: function (userId, doc) {
return true;
}
});
示例5: loggedIn
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { PipeUser } from '../models/user.model';
export const PipeUsers = new MongoObservable.Collection<PipeUser>('pipeUsers', {idGeneration: 'MONGO'});
function loggedIn() {
return !!Meteor.user();
}
PipeUsers.allow({
insert: loggedIn,
update: loggedIn,
remove: loggedIn
});
示例6: function
Meteor.publish('tasks.public', function() {
return Tasks.find({
$or: [
{ private: { $ne: true } },
{ owner: this.userId }
]
});
});