azure-cosmosdb

Check the content of an array — CosmosDB

…衆ロ難τιáo~ 提交于 2019-12-25 00:10:03
问题 I query a CosmosDB database using the following query : SELECT c.EventType.EndDeviceEventDetail FROM c WHERE (c.EventType.EndDeviceEventType.eventOrAction = '93' AND c.EventType.EndDeviceEventType.subdomain = '137' AND c.EventType.EndDeviceEventType.domain = '26' AND c.EventType.EndDeviceEventType.type = '3') I get as a response [ { "EndDeviceEventDetail": [ { "name": "Spontaneous", "value": "true" }, { "name": "DetectionActive", "value": "true" }, { "name": "RCDSwitchReleased", "value":

Azure CosmosDb DocumentQuery returns HasMoreResults as true but ExecuteNextASync returns 0 count

牧云@^-^@ 提交于 2019-12-24 22:52:11
问题 I am trying to retrieve results from Azure CosmosDb. Below code returns HasMoreResults equal to true; however when I call ExecuteNextASync; I don't get any result. I have read through a few similar issues but could not yet identify a definitive solution. Thanks for the help! public async Task<List<Trackers>> GetTrackersDataAsync() { try { var query = client.CreateDocumentQuery<Trackers>(collectionLink, new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = true }) .OrderByDescending

Delete documents from Azure cosmos DB collection with multiple Partition Keys

╄→尐↘猪︶ㄣ 提交于 2019-12-24 22:17:09
问题 I have to delete some documents from azure cosmos DB through azure portal. I wrote a stored procedure in container which will delete the data which has to be deleted. But at the time of execution of stored procedure it will ask for partition key value. I have to delete documents which are having different partition keys. Below given is the Stored Procedure Used. function bulkDeleteProcedure(deletedate) { var collection = getContext().getCollection(); var collectionLink = collection

Azure function is giving not a valid Base-64 string error

社会主义新天地 提交于 2019-12-24 22:12:19
问题 I have a http-trigger with a CosmosDB output binding and a simplest of a function as below. public static class AddRequest { [FunctionName("AddRequest")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger log, [CosmosDB( databaseName: "haveThatDB", collectionName: "Requests", ConnectionStringSetting = "MongoDBEndPoint",CreateIfNotExists =true)] IAsyncCollector<Request> requestOutput ) { string jsonContent =

CosmosDB - SubDocument Delselecting - LINQ Query

不羁的心 提交于 2019-12-24 21:54:35
问题 I have a ProductDocument model in CosmosDB, which represents a Product. Within that model there is a subdocument contributors which holds who has contributed to the Product. Each contributor has a role . Now I have been experimenting with a query that needs to: Only select ProductDocument with a contributor.roleDescription of Author Only select ProductDocument with a division of Pub 1 Only include contributors sub documents with a contributor.roleDescription of Author in the result set. Now I

How to delete many documents in a partitioned collection in Azure CosmosDB using MongoDB API

て烟熏妆下的殇ゞ 提交于 2019-12-24 20:43:44
问题 Consider the following document type class Info { public string Id { get; set; } public string UserId { get; set; } // used as partition key public DateTime CreatedAt { get; set; } } I've created a collection using this var bson = new BsonDocument { { "shardCollection", "mydb.userInfo" }, { "key", new BsonDocument(shardKey, "hashed") } }; database.RunCommand(new BsonDocumentCommand<BsonDocument>(bson)); To delete all documents that are older than a certain date, I tried this collection

Is it possible to use MongoDB Views with Azure CosmosDB?

[亡魂溺海] 提交于 2019-12-24 19:53:13
问题 I tried to create a view via Robo3T. The command executes successfully, but the view is always empty, no matter how I specify the aggregation pipeline for the view. Example: db.createView("testView","originCollection", [{ $project : { _id: 1 } }]) Does CosmosDB even support views for MongoDB? Edit: As Kevin Smith asked in comments db.testView.stats() returns: { "_t" : "CollStatsResponse", "ok" : 1, "ns" : "myDb.testView", "count" : 0.0, "size" : 0, "avgObjSize" : 0, "numExtents" : 0,

cosmos db, generate authentication key on client for Azure Table endpoint

南笙酒味 提交于 2019-12-24 19:16:30
问题 Cosmos DB, API Azure Tables, gives you 2 endpoints in the Overview blade Document Endpoint Azure Table Endpoint An example of (1) is https://myname.documents.azure.com/dbs/tempdb/colls An example of (2) is https://myname.table.cosmosdb.azure.com/FirstTestTable?$filter=PartitionKey%20eq%20'car'%20and%20RowKey%20eq%20'124' You can create the authorization code for (1) on the client using the prerequest code from this Postman script: https://github.com/MicrosoftCSA/documentdb-postman-collection

How to get a document in mongoDb via a nested property through .net mongoDb driver

旧巷老猫 提交于 2019-12-24 17:06:52
问题 Suppose i have following document in some collection [{ "name": "Man1", "Childrens": [ { "name": "Children 1", "age": "12" }, { "name": "Children 2", "age": "18" }, ] }, { "name": "Man1", "Childrens": [ { "name": "Children 3", "age": "12" }, { "name": "Children 4", "age": "18" }, ] } ] i want to get the document where name of one of the children is "Children 1" I want to achieve this via .net mongo driver var bQuery = String.Format("{{ '{0}':'{1}' }}","Childrens.name","Children 1"); var

How can I get an exclusive subgraph from a vertex?

本小妞迷上赌 提交于 2019-12-24 10:56:15
问题 I've recently had to change from using Cypher to Gremlin and I'm trying to convert a query that allowed a user to 'delete' a node and all of the subgraph nodes that would be affected by this. It wasn't actually removing nodes but just adding a 'DELETED' label to the affected nodes. I can get a subgraph in Gremlin using: g.V(nodeId).repeat(__.inE('memberOf').subgraph('subGraph').outV()).cap('subGraph') but this doesn't take into account any nodes in the subgraph that might have a route back