本文整理汇总了TypeScript中collections/parties.Parties.find方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Parties.find方法的具体用法?TypeScript Parties.find怎么用?TypeScript Parties.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collections/parties.Parties
的用法示例。
在下文中一共展示了Parties.find方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loadParties
export function loadParties() {
if (Parties.find().count() === 0) {
var parties = [
{
'name': 'Dubstep-Free Zone',
'description': 'Can we please just for an evening not listen to dubstep.',
'location': 'Palo Alto'
},
{
'name': 'All dubstep all the time',
'description': 'Get it on!',
'location': 'Palo Alto'
},
{
'name': 'Savage lounging',
'description': 'Leisure suit required. And only fiercest manners.',
'location': 'San Francisco'
}
];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
}
};
示例2: loadParties
export function loadParties() {
if (Parties.find().count() === 0) {
var parties = [
{
'name': 'Dubstep-Free Zone',
'description': 'Can we please just for an evening not listen to dubstep.',
'location': {
name: 'Palo Alto'
},
'public': true
},
{
'name': 'All dubstep all the time',
'description': 'Get it on!',
'location': {
name: 'Palo Alto'
},
'public': true
},
{
'name': 'Savage lounging',
'description': 'Leisure suit required. And only fiercest manners.',
'location': {
name : 'San Francisco'
},
'public': false
}
];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
Accounts.createUser({
username: 'admin',
email: 'admin@socially.com',
password: 'party'
});
Accounts.createUser({
username: 'user',
email: 'user@socially.com',
password: 'party'
});
}
};
示例3: loadTestData
export function loadTestData() {
if (Parties.find().count() === 0) {
var parties = [{
'name': 'Dubstep-Free Zone',
'location': 'Mountain View',
'description': 'Can we please just for an evening not listen to dubstep.'
}, {
'name': 'All dubstep all the time',
'location': 'Mountain View',
'description': 'Get it on!'
}, {
'name': 'Savage lounging',
'location': 'Palo Alto',
'description': 'Leisure suit required. And only fiercest manners.'
}];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
var locations = ['Mountain View', 'Palo Alto'];
for (var i = 0; i < 1000; i++) {
var location = locations[(Math.random() * 2) >> 0];
Parties.insert({
name: Fake.sentence(50),
location: location,
description: Fake.sentence(100)
});
}
Accounts.createUser({
username: 'party',
email: 'admin@socially.com',
password: 'admin'
});
}
}
示例4: function
Meteor.publish('party', function(partyId: string) {
return Parties.find(buildQuery.call(this, partyId));
});
示例5: constructor
constructor () {
this.parties = Parties.find();
}
示例6: function
Meteor.publish('parties', function() {
return Parties.find(buildQuery.call(this));
});
示例7:
this.autorun(() => {
var selector = { location: this.location.get() };
this.parties = Parties.find(selector);
}, true);
示例8:
this.subscribe('parties', () => {
this.parties = Parties.find();
}, true);
示例9: function
Meteor.publish('party', function(partyId: string) {
return Parties.find(partyId);
});