本文整理匯總了TypeScript中collections/parties.Parties.insert方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Parties.insert方法的具體用法?TypeScript Parties.insert怎麽用?TypeScript Parties.insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類collections/parties.Parties
的用法示例。
在下文中一共展示了Parties.insert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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'
});
}
}
示例3: 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'
});
}
};