var user = Users.findOne();
user.insertAt(0);
someCollectionOfItems.insertAt(user, 0)
user.insertAt(someCollectionOfItems, 0)
MyStuff.find({}, {sort: {order: -1}})
Yes documentation is not detailed enough. When you create a new document:
var u = new User();
You have to insert it into collection using:
user.insertAt(0);
You don't use the save()
method.
To get documents already sorted you have to use:
User.find();
Notice that it's the class constructor not collection.
_original
object inside data I retrieve from mongo. I tried to exclude it via Things.find({}, {fields: {_original: 0}}).fetch()
but it still comes through. is this costing me anything in terms of bandwidth? or is it something added on with astronomy that doesn't go through the DDP connection?
DelegateId: {
type: 'string',
default:''
},
Delegate: {
type: 'string',
default:'',
transient: true
},
relations: {
delegate: {
type: 'one',
class: 'Contact',
local: 'DelegateId',
foreign: '_id'
}
},