public DataBlockImport() { this.CreateWithId = false; this.Save = SaveTypes.CreateUpdate; this.Delete = DeleteTypes.None; this.UpdateInactive = false; this.UpdateIdentical = false; }
private void fileDelete(NeoAssets.Mongo.NeoVirtFS rec, DeleteTypes dType) { // Remove file node from main file, move to the deleted list // Don't forget to mark the dtim rec.Stat.st_dtim = DateTimeOffset.UtcNow; rec.DeleteType = dType; // Upsert to the deleted collection - maybe this should be in a unit of work? var filter = Builders <NeoAssets.Mongo.NeoVirtFS> .Filter.Eq(x => x._id, rec._id); var insert = NeoVirtFSDeletedCol.ReplaceOneAsync(filter, rec, options: new ReplaceOptions { IsUpsert = true }); // Remove from the original collection NeoVirtFSCol.DeleteOne(filter); }