private static void UpdateEntry(UpdateIndexEntry update, List <WriteModel <MongoTextIndexEntity <T> > > writes) { writes.Add( new UpdateOneModel <MongoTextIndexEntity <T> >( Filter.Eq(x => x.DocId, update.DocId), Update .Set(x => x.ServeAll, update.ServeAll) .Set(x => x.ServePublished, update.ServePublished))); }
private static void UpdateEntry(UpdateIndexEntry update, IList <IndexDocumentsAction <SearchDocument> > batch) { var document = new SearchDocument { ["docId"] = update.DocId.ToBase64(), ["serveAll"] = update.ServeAll, ["servePublished"] = update.ServePublished, }; batch.Add(IndexDocumentsAction.MergeOrUpload(document)); }
private async Task UpdateAsync(UpdateIndexEntry update) { var data = new { doc = new { update.ServeAll, update.ServePublished } }; var result = await client.UpdateAsync <StringResponse>(IndexName, update.DocId, CreatePost(data)); if (!result.Success) { throw new InvalidOperationException($"Failed with ${result.Body}", result.OriginalException); } }
private static void UpdateEntry(UpdateIndexEntry update, List <object> args, string indexName) { args.Add(new { update = new { _id = update.DocId, _index = indexName } }); args.Add(new { doc = new { serveAll = update.ServeAll, servePublished = update.ServePublished } }); }
private void Update(UpdateIndexEntry update, List <object> args) { args.Add(new { update = new { _id = update.DocId, _index = indexName, } }); args.Add(new { doc = new { serveAll = update.ServeAll, servePublished = update.ServePublished } }); }