Azure cosmosdb Migrating Orient Vertex to Cosmos DB using gremlin query

So i have an orient 2.0.0 db, and i want to move this db to cosmos db. The technology i am using is .Net, so i can not use java, and the other richer drivers. The main problem i am facing during migration is that my orient vertex contain properties that are objects. So is there a way to add objects as property using gremlin query into cosmos db. The examples on tinkerpop doc, and Azure Cosmos DB Docs for gremlin all show adding simple data types only.

Azure cosmosdb Cosmos DB Gremlin "project" not producing expected results

I have the following traversal that shows that the selected Vertex has 14 Edges labeled "follows". g.V().has('user','email','').project('name','email','follow-edges').by('name').by('email').by(outE().hasLabel('follows').project('id','inV').by('id').by('inV')) Which produces the following results: [{ "name": "David", "email": "", "follow-edges": 14}] But when I want to project the "follows" Edge's id and inV ids, I'm only getting one result item back. g.V().has('us

Azure cosmosdb Sort by the most recent to the oldest in Azure Cosmos Table not working

According to this article, if save RowKey to string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks); then I can always pick the most recent record by using azure.TableQuery().top(1); But actually it's not works like there, the most recent add row unable to be pick up. I tested it by manually adding two rows, with Rowkey in following values 2518658399914874511 a

Azure cosmosdb Property reference is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause

Azure Cosmos Document DB throws an error on executing a query like this - SELECT DISTINCT VALUE { DocumentName: c.Name, Count: COUNT(, Target: c.Target } FROM c where c.Target != null Error - SC2102: Property reference 'c.Name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause SC2102: Property reference 'c.Target' is invalid in the select list because it is not contained in either an aggregate function or the GR

Azure cosmosdb How I do this subquery correctly?

I get error 400 on Cosmos when I put this query with subquery. I need do this task on one query: SELECT DISTINCT VALUE c.Nome FROM c WHERE c.Id = 0456 AND c.Tipo NOT IN (SELECT DISTINCT VALUE c.Tipo FROM c WHERE c.Materiais IN (55)) AND c.Materiais NOT IN (55) The two queries work separately. How can I do it together?

Azure cosmosdb Composite index for optional field in Cosmos

I have a collection in Cosmos DB which contains documents of different types (and schemas): { "partKey": "...", "type": "type1", "data": { "field1": 123, "field2": "sdfsdf" } } { "partKey": "...", "type": "type2", "data": { "field3": ["123", "456", "789"] } } I'm trying to create a composite index [/type, /data/field3/[]/?], but faced an issue: The indexing path '\\/data\\/field3\\/[]\\/?' could not be accepted, failed near position '15'. Please ensure that the path is a v

Azure cosmosdb Same query on same data consumes as much as double the RUs between calls

We have a cosmos db container where documents are inserted (append-only). We are seeing the same query consume wildly varying RUs even though the number of matching documents did not change. I am able to reproduce in Data Explorer. Query: select * from c where c.Id=<someId> and c.Version > <someVersion> order by c.Version asc PartitionKeyPath = /Id When it's executed successively in DataExplorer, I get the following query statistics: Request Charge = 4857.38 RUs, Index lookup

Azure cosmosdb How to connect to cosmosdb emulator from firefox OSX outside of VM?

I have followed these instructions for setting up the cosmosdb local emulator. instructions. My use case is not covered there. I want to view the cosmosdb emulator start page outside the VM on firefox. Inside the VM it is located at: I started the emulator with the /AllowNetworkAccess /NoFirewall flags. Furthermore I disabled TLS/SSL in firefox by doing it in the about:config section. I still cannot view the index.html file from outside the VM. How do

Azure cosmosdb Cosmos client and versioning of records

I'm working on a web api where I need to store all previous versions of a record, so for the Put endpoint, instead of updating an existing record, a new record is created, with the same partition key. This complicates things a lot, and a simple Read method, which should give you the most recently created record becomes: public async Task<IEnumerable<T>> ReadLatestAsync(Expression<Func<T, bool>> predicate) { var entityList = new List<T>(); var q

Azure cosmosdb OMS reports DocumentDb listKeys failure

We have a weird error reported by OMS that we cannot track down. I've looked for documentation on this error with no luck. The error reported by OMS is: OperationName: Microsoft.DocumentDb/databaseAccounts/listKeys/action Level: Error ActivityStatus: Failed ActivitySubstatus: 499 ResourceGroup: Our own Azure hosted API Category: Administrative HTTPRequest: { "clientRequestId": "[]", "clientIpAddress": "[]", "method": "POST" } Properties: {

Azure cosmosdb Trouble simultaneously fetching filtered vertices and unfiltered vertices count

I'm trying to return a limited number of vertices matching a pattern, as well as the total (non-limited) count of vertices matching that pattern. g.V() .hasLabel("PersonPublic") .has('partitionKey', "Q2r1NaG6KWdScX4RaeZs") .has('docId', "Q2r1NaG6KWdScX4RaeZs") .out("CONTACT_LIST") .out("SUBSCRIBER") .dedup() .order() .by("identifier") .by("docId") .fold() .project('people','total') .by( unfold() .has('docId', gt("23")), .limit(2) .project('t

Azure cosmosdb Is it better have high cardinality of partition key?

My understanding it's good to have high cardinality for choosing partition key. What I'm confused is how this impacts RUs. If you have cardinality partition key and you say issue update for specific value of partition key it would mean that all traffic will go into single partition and create "hot" partition and this will result in rate limiting per microsoft docs.

Azure cosmosdb Cosmos DB Emulator won't start on Windows 10

I’m recieving this error when I try to start Cosmos Emulator Tried it on a fresh win10 machine, and it's working here. Any ideas on what might course this? I tried all the suggestions in this article. Looking at the etl file didn't give my anything either. It's the first time I try to install it on my machine. -- UPDATE -- I opened the dmp file, and found this: Loading Dump File [C:\Users\xxx\AppData\Local\CrashDumps\Microsoft.Azure.Cosmos.StartupEntryPoint.exe(1).12596.dmp]

Azure cosmosdb Cosmos DB - Restore Backup

I have some doubts about Cosmo backup/restore. I already undestand that Cosmos backup is done every 4 hours on Blob Storage. But How can I restore this backup if I need in case of a disaster recovery? It will restore all the engine or I have to create another engine of Cosmos and restore the data?

Azure cosmosdb What happens if you try to read data immediately after a write in a strongly consistent cosmos DB?

I have recently started reading up a little on Cosmos DB and found that they have 5 consistency settings from strongly consistent to eventually consistent and everything in between. Suppose I have chosen a strongly consistent setting. Now if I update the address for someone with a Social security number of 123-45-6789 and then I immediately try to read it, will it block me until it updates a majority of the copies? Or will it just give me old data until all the required number of copies have be

Azure cosmosdb Getting an Incorrect Syntax Error in CosmosDB When Using BETWEEN Statement For ISO 8601 Formatted DateTime

When I tried to execute the following query in CosmosDB I got the error Syntax error, incorrect syntax near 'BETWEEN'. SELECT TOP 5 * FROM c WHERE c.ApplicationName = "SampleApp" AND c.TimeStamp BETWEEN "20200902T095000Z" AND "20200902T095100Z" I've seen in other articles that I should convert the date/time to an ISO 8601 string but still no luck. Please note that our TimeStamp field is stored as a string using the following format: "2020-09-02T09:50:00.000&q

Azure cosmosdb Azure Cosmos Db document partition key having duplicate, but find duplicate document with combination of other columns

I have below document JSON (pasted partial JSON, actual JSON will be complex and embedded). The JSON has Code as ParitionKey, I am trying to build No SQL database documents by migrating my sql tables, and I will have Code, Type making Unique row, as you can see below Code = 4 is duplicated with different Type and id I just generated GUID (not sure on id field so generated GUID and assigned to it). we only have two values for Type filed, it's either RI or NRI for entire data, and Code is duplicat

Azure cosmosdb Cosmos Db not returning all records even though maxItemCount set to -1

I have a cosmos database with 50 000 records, but the code bellow only only returns 8356. I thought setting MaxItemCount to -1 would return all of them. How can I achieve that? public async Task<IEnumerable<T>> ReadAsync(Expression<Func<T, bool>> predicate) { var entityList = new List<T>(); var query = _container.GetItemLinqQueryable<T>(requestOptions: new QueryRequestOptions { MaxItemCount = -1 }) .Where(predica

Azure cosmosdb Defining variables in Azure Cosmos DB Graph query

I am struggling with running the pagination script on Azure Cosmos DB Graph, using Gremlin.NET: t = g.V().hasLabel('person');[] It comes from Tinkerpop page where it is described how to reuse traversal instance to avoid loading the whole graph. Unfortunately, in Gremlin .NET I get: ExceptionType : GraphSyntaxException ExceptionMessage : Gremlin query syntax error: Unsupported groovy expression kind: t=g.V().hasLabel('person') @ line 1, column 1. Probably this kinda struct

Azure cosmosdb How to find documents in DocumentDB where a property (array of objects) contains an object with a given criteria

I want to query a Microsoft Azure DocumentDB collection to get all documents whose "array" property (in JSON speech) contains an object which matches a given filter condition. This is my document: public class CouponReadModel { public List<Models.BookEntry> BookEntries { get; set; } // some other properties public class Models { public class BookEntry { public Guid OrderId { get; set; } // some other properties }

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

Cosmos DB, API Azure Tables, gives you 2 endpoints in the Overview blade Document Endpoint Azure Table Endpoint An example of (1) is An example of (2) is$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:

Azure cosmosdb Document/CosmosDB .Net client "DISTINCT" query error

I have a collection that contains documents with the following structure: { "Identifier": 1, "Values": { "value1": "33806", "value2": "10", "value3": "0" }, ... } I have created a UDF to extract the keys from the Values dictionary: function getKeys(dictionary) { let result = []; for (var key in dictionary) { result.push(key); } return result; } And I have a query that uses the UDF to find all the distinct keys in the Values dic

Azure cosmosdb Consistency guarantees of Cosmos DB in local region

I have a cosmos db instance with only one read region and write region. In my case, what do the consistency guarantees provided by Cosmos DB mean? To be precise, I do a write W to a document. I do a read R on the same document. If I have chosen 'Eventual Consistency', is there a possibility that I see a write older than W even if I have a single read and write region?

Azure cosmosdb GraphDb Indexing Policies

Consider the following json responses.. If you run the graph query g.V().hasLabel('customer'), the response is: [ { "id": "75b9bddc-4008-43d7-a24c-8b138735a36a", "label": "customer", "type": "vertex", "properties": { "partitionKey": [ { "id": "75b9bddc-4008-43d7-a24c-8b138735a36a|partitionKey", "value": 1 } ] } } ] If you run the sql query select * from c where c.label = 'customer', the response is: [ { "lab

Azure cosmosdb DocumentDB paging with many collections

Lets say I have two collections and there are 10 documents in each collection. What is the recommended way to do paging if i want to retrive max 15 documents? When I run the code below I get 20 results. It begins requesting the first collection which returnes 10 and then the second which also returns 10 but it should return 5 since the MaxItemCount is 15. var batches = new List<IEnumerable<T>>(); var feedOptions = new FeedOptions { MaxItemCount =

Azure cosmosdb Can I create graph edges between documents in cosmos db?

I have a cosmos db with a bunch of documents that were added through the documents api. I used the graph client to create edges between those existing documents. For example: await _client.CreateGremlinQuery<dynamic>(docCollection, $"g.V('{member.Id}')" + $".addE('post')" + $".to(g.V('{post.Id}'))") .ExecuteNextAsync(); This "works" and it creates the edge. The problem is when I want to fetch back the connected vertices for

Azure cosmosdb Get the latest document based on a document's property in Azure Cosmos DB

Let's say that I have a Cosmos DB collection with the SQL API that contains a list of messages that people have sent that give their current mood and a timestamp of when the message has been received. People can send messages whenever they want. In my collection I have something that looks like this: [ { "PersonName": "John", "CurrentMood": "Moody", "TimeStamp": "2012-04-23T18:25:43.511Z", "id": "25123829-1745-0a09-5436-9cf8bdcc95e3" }, { "PersonName"

Azure cosmosdb CosmosDB stored procedure

I am reading document from collection and storing 2 different variables. But whenever I remove any key from the JSON it affects first variables result. I want to keep both of them independent so that change of one will not reflect other. var query = 'SELECT * FROM c where = "XYZ" var accept = collection.queryDocuments(collection.getSelfLink(), filterQuery, function (err, documents, responseOptions) { if (err) throw new Error("Error" + err.mes

Azure cosmosdb Optimal Partition Allocation

I am using Azure Cosmos DB for holding a variety of different document types. I have read various documentation and am not clear on partition size. Having many logical partitions across the data has many benefits around performance. What I don't fully understand is how to determine how many partitions to have. Are we better to have 1 million partitions of 10 records 10 partitions of 1 million records Is there some sweet spot for partition size that we should be targeting?

Azure cosmosdb Azure Cosmos DB Emulator on a Local Area Network

I am trying to access Azure Cosmos DB Emulator through a Mac. The emulator is installed on Windows 10 machine. Both machines are obviously part of the local network. I am able to browse the emulator explorer on Windows 10 machine using the following addresses: 1) https://localhost:8081/_explorer/index.html 2) However I am not able to browse the emulator explorer on Windows 10 machine using the following address: 1)

Azure cosmosdb CosmosDB - Entity Framework Core - Contains could not be translated

I try to manipulate a CosmosDB (SQL) using entity framework core 3.0 (Microsoft.EntityFrameworkCore.Cosmos 3.0.0). Everything works fine except when I try to use Contains, StartWith, … For example: var query = _context.Challenges.Where(c => c.Name.Contains( "string")); EF is supposed to translate it to the following SQL (that works perfectly on the CosmosDB – Query Explorer) SELECT * FROM c WHERE CONTAINS(c.Name, "string") But I receive the following error message: The LINQ expression

Azure cosmosdb Cosmos DB - Getting error while creating a partition key "Cross partition query is required but disabled"

I am getting following error while creating a partition key in cosmos DB. Exception while executing function: SetUserSubscriptions -> Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception.\r\nActivityId: 4685a5b7-bce9-4855-b2d8-33353f2957d9, Microsoft.Azure.Documents.Common/, documentdb-dotnet-sdk/2.1.3 Host/32-bit MicrosoftWindowsNT/6

Azure cosmosdb Azure cosmos db data (SQL API) into Grafana

I am trying to connect Azure Data explorer plugin data source in grafana but we don’t have cluster setup for my azure application and I can’t provide cluster url in that plugin. I tried simple JSON plugin but it requires a http url and our Azure portal url is https. Do we have any alternatives plugins or any other way to access Azure cosmos db data SQL API into grafana? Thanks for your help! Regards, Sreenivasa

Azure cosmosdb ChangeFeedProcessorBuilder checkpointing after unsuccessful processing

I was investigating the behavior of a ChangeFeedProcessorBuilder processor1 that throws an exception or goes down while processing the particular change. Upon recovery, the same change will not be picked up anymore. Is there any way to checkpoint only after the successful processing of the notification? The delegate is as follows: var builder = container.GetChangeFeedProcessorBuilder("migrationProcessor", (IReadOnlyCollection<object> input, CancellationTok

Azure cosmosdb Where to find condition value when using Add-AzMetricAlertRuleV2 in Azure powershell?

I am very new to Azure and currently looking for assistance to help me start my project. Recently I am trying to automate the process of adding alerts for our Azure CosmosDB. After some research, it looks like I can use Add-AzMetricAlertRuleV2 to add alerts through powershell. According to MS online document I will need to pass $condition to add the rule to the existing ResourceGroup. Where can I get all the existing conditions that I can add to the rule so I can sort out the one that is needed?

Azure cosmosdb Querying large amounts of data in Azure Cosmos SQL API

We have a simple 3 tier application built in Angular, .Net Core 3.1 Web API, and Azure Cosmos database. This application gathers large amounts of data, including geo location (lat and long), which then users can query and view via the Angular app. Our problem is that need to query the full dataset to visualize it in a map and we're running into significant performance issues when querying the data. There are currently 2.5 million records in the database, and it takes ~10 mins to pull them all, w

Azure cosmosdb The SQL query text exceeded the maximum limit of 30720 characters in Azure CosmosDB

I have a query where I use an array with an "IN" style setup. var builder = Builders<Transaction>.Filter; var filter = builder.Eq("App", app) & builder.In("TransactionId", incomingIds); List<string> existingTransactions = collection .Find(filter) .Project(x => x.TransactionId) .ToList(); A while back this started to throw the error below and I had reduce my batch-size significantly to avoid the error

Azure cosmosdb CosmosDB/DocumentDB partitioning with multiple types in same collection

Official recommendation from the team is, to my knowledge, to put all datatypes into single collection that have something like type=someType field on documents to distinguish types. Now, if we assume large databases with partitioning where different object types can be: Completely different fields (so no common field for partitioning) Related (through reference) How to organize things so that things that should go together end up in same partition? For example, lets say we have: User Bl

Azure cosmosdb Use Traversal to query Azure Cosmos DB graph

I am trying to use Traversal to query an Azure Cosmos DB graph as follows val cluster ="remote.yaml")).create() val client = cluster.connect() val graph = EmptyGraph.instance() val g = graph.traversal().withRemote(DriverRemoteConnection.using(cluster)) val traversal = g.V().count() val aliased = client.alias("g") val result = aliased.submit(traversal) val resultList = result.all().get() resultList.forEach { println(it) } Problem is execution hangs after result.all().g

Azure cosmosdb CosmosDB 429 appears in azure portal but c# code against same collection/database not raise 429 exception

At specific given point in time, if we refer azure portal metrics option against our cosmos db account it shows 429 happened many times but c# code written (for same cosmos db account/database/collection) using cosmos sql sdk, not throwing 429 even for single time because of that RUs scale up logic written for the every occurrence of 429/throttle issue is not getting triggered at all. Confusion is whether throttle happened like azure portal shows or it is projecting wrong data. Which one to cons

Azure cosmosdb Are Cosmos DB indexes range by default?

I have a cosmos db that's around 4gb which when it was small could perform date filters relatively quickly with a low RU value (3 - 15ish) but as the DB has grown to contain millions of records it now has slowed right down and the RU value is up in the thousands. Looking at the documentation for date is says To execute these queries efficiently, you must configure your collection for Range indexing on strings However r

  1    2   3   4   5   6  ... 下一页 共 6 页