Closed thearabbit closed 1 year ago
Excuse me, I still have problem with multiple attach schema (I would like to create collection behaviours)
multiple attach schema
collection behaviours
// Soft Remove CollectionExtensions.addPrototype('softRemove', function(selector = {}) { let self = this const schema = new SimpleSchema({ removed: { type: Boolean, }, removedAt: { type: Date, }, removedBy: { type: String, }, }) self.attachSchema(schema, {selector: {type: 'softRemove'}}); return self.direct.update( selector, { $set: { removed: true, removedAt: new Date(), removedBy: Meteor.userId(), }, }, { multi: true, selector: {type: 'softRemove'} }, (error, result) => { if (result) { console.log('soft-remove') } } ) })
But have problem when I update collection, It is required soft remove field Please help me
soft remove field
This should work. You would need to post the full error you get or a full reproduction
Closing due to lack of reproduction.
Excuse me, I still have problem with
multiple attach schema
(I would like to createcollection behaviours
)But have problem when I update collection, It is required
soft remove field
Please help me