azure-cosmosdb 相关问题

Azure Cosmos DB是一种全球分布式数据库服务,旨在使用户能够通过全面的SLA弹性地和独立地扩展任意数量地理区域的吞吐量和存储。您可以使用一系列流行的API和编程模型,使用Cosmos DB开发文档,键/值或图形数据库。

将数据从 Cosmos 数据库帐户导出到另一个帐户的最佳方法

我想要做的事情类似于我们可以轻松地使用Azure Sql Server数据库做的事情,我们可以单击复制功能在另一个Sql Server中创建相同的数据库。 我没看到...

回答 1 投票 0

如何使用 Azure Cosmos Db 对 EF Core 中的数据进行非规范化?

如本文档所示:https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/model-partition-example#v2-introducing-denormalization-to-optimize-read-queries 我需要对实体进行非规范化

回答 1 投票 0

适用于 CosmosDb 恢复的 Az Cli 设置最低 TLS 版本

我们制定了一项政策,仅允许使用最低 TLS1.2 的 CosmosDb。 我正在尝试使用 Az Cli 进行灾难恢复,但恢复会使用默认 TLS1.0 创建一个新的 CosmosDb 帐户 这里是...

回答 1 投票 0

JavaScript Azure Function v4 在从 cosmos db 获取记录期间挂起

我正在学习 Azure 函数并遇到了问题。 从 cosmos db 获取记录时,该函数挂起。 我使用 cosmos db 模拟器。 该函数可以正常工作,无需获取 r 的代码...

回答 1 投票 0

Azure Synapse Pyspark 作业可以看到从 CosmosDB 中删除的记录

我们有访问 CosmosDB 表(链接服务)的 Pyspark 脚本。我们从 CosmosDB 表中删除了所有记录(通过减少 TTL)。但我仍然看到Pyspar删除的记录...

回答 1 投票 0

如何查询 Cosmos DB 以查找不同条件下项目的 SUM?

这是我的 Cosmos 数据库中的一个示例项目: { “id”:“a683-89e01def5310”, “作业 ID”:“123”, “拍卖站点Id”:100, “状态...

回答 1 投票 0

cosmos DB 中的吞吐量性能

我在 Cosmos DB 中有一个容器,其中包含大约 1000 万个文档。使用 cosmos.oltp 库集成从 Databricks 加载大约需要 3 小时。 在 Cosmos DB 上,我们看到很多 429 错误...

回答 1 投票 0

将 CosmosDB Serverless 转换为预置吞吐量数据库

我正准备创建一个与 CosmosDB 通信的全新移动应用程序,我可能会采用无服务器方式。与

回答 2 投票 0

Cosmos DB 中的吞吐量配置

我计划从 Azure SQL Server 切换到 CosmosDB。我每天要读取大约 27-3000 万条数据进行处理。这是我想要执行这些事情的方式: 从 Kafka 和 s 读取数据...

回答 1 投票 0

如何使用 Azure AI 搜索对 Cosmos 数据源中的特定集合建立索引?

我已为 Azure AI 搜索和 CosmosDB 设置资源。在我的一个 CosmosDB 资源中,我有两个包含文档的集合:Collection1 和 Collection2。 创建索引时或

回答 1 投票 0

使用Azure Function将多个对象输出到CosmosDB(隔离进程)

我似乎找不到任何有关如何从 Azure Function 隔离进程将多个文档输出到 Azure CosmosDB 的文档。 我理解“因为 .NET 独立项目在 9 月份运行......

回答 2 投票 0

CosmosDB NoSQL - 过滤两个 JSON 属性以获取格式化为数字和字符串的 ID 列表

我正在尝试获取其 Fields.FieldId 在数字列表中的行(例如:7942 到 7950)或其 Fields.ParentFieldReference 在相同的数字列表中但采用字符串格式(例如:“7942” ...

回答 1 投票 0

使用延续令牌通过 Python SDK 对 Azure CosmosDB 进行分页

我正在尝试使用 API 和 Azure Cosmos Python SDK 来实现分页。根据我的阅读和理解,我们需要延续令牌。但是,我在 SDK 中找不到任何功能

回答 2 投票 0

我可以编写一个模仿 Cosmos 中 Is_Defined 的 C# lambda 吗?

我可以编写 select * from c where Not Is_Defined(c.Name) 来获取所有缺少 Name 属性的文档。 是否可以像 C# lambda 一样执行? x => x.Name == null 不起作用,因为 lambda 是

回答 1 投票 0

在 ASP.NET Core 中使用分区键的 CosmosDB 查询错误

我正在开发一个应用程序,该应用程序根据对象的 ID 从 NoSQL CosmosDB 中提取对象。该容器具有以下详细信息: 容器名称:ScenariosTable 分区键:/_partitionKey T...

回答 1 投票 0

如何使用 ADF 通过复制任务和一些条件将数据从一个 Cosmos 数据库迁移到另一个 Cosmos 数据库

我有两个 Azure Cosmos 数据库,我需要将数据从一个数据库迁移到另一个数据库。但是接收器容器已经有数据了。我需要检查源和目的地的时间戳并更新目的地...

回答 1 投票 0

在 Cosmos 数据库上使用 LINQ Skip Take 是否支持服务器端分页?

使用Cosmos SDK V3。 在以下示例中,Cosmos 是否支持服务器端分页的 LINQ 跳过和 Take ? 根据我的分析,虽然我能够检索数据,但似乎查询不行......

回答 3 投票 0

如何在cosmos db中为容器创建新记录?

努力弄清楚如何在我的业余项目中使用cosmos db。 并且无法理解我如何为容器创建新记录。 我有一些通用存储库方法,该调用者...

回答 1 投票 0

如何使用 Azure 门户清除 Cosmos DB 数据库或删除所有项目

如果转到 https://portal.azure.com,打开我们的 Azure Cosmos DB 帐户 (1) --> 数据资源管理器 (2) --> 单击用户 (3) --> 单击新建 SQL 查询: Azure 将打开一个文本框以输入查询...

回答 6 投票 0

Java | Maven| IntelliJ |蔚蓝宇宙|构建和运行失败

我正在尝试连接 Azure Cosmos 并尝试检索数据,但由于以下问题(编译时间)而失败。 ===========启动1.POM.xml====================== 我正在尝试连接 Azure Cosmos 并尝试检索数据,但由于以下问题(编译时间)而失败。 ============开始1.POM.xml======================== <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.beginsecure</groupId> <artifactId>CosmosUtility</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>20</maven.compiler.source> <maven.compiler.target>20</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>com.azure</groupId> <artifactId>azure-sdk-bom</artifactId> <version>1.2.23</version> <type>pom</type> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.azure</groupId> <artifactId>azure-identity</artifactId> <version>1.12.0</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-cosmos</artifactId> <version>4.58.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.32</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20240303</version> </dependency> </dependencies> </project> ============结束1.POM.xml======================== ============启动2.CosmosHelper.java==================== package com.beginsecure; import com.azure.identity.ChainedTokenCredential; import com.azure.identity.DefaultAzureCredential; import com.azure.identity.ManagedIdentityCredential; import com.azure.core.credential.TokenCredential; import com.azure.cosmos.*; import com.azure.cosmos.CosmosClient; import com.azure.identity.DefaultAzureCredentialBuilder; public class CosmosHelper { private CosmosAsyncClient client; private String databaseName; public CosmosHelper(String cosmosEndPoint, String managedIdentity, String dbName) { System.out.printf(dbName); DefaultAzureCredential defaultCredential = new DefaultAzureCredentialBuilder() .managedIdentityClientId(managedIdentity) .build(); this.client = new CosmosClientBuilder() .endpoint(cosmosEndPoint) .credential(defaultCredential) .buildAsyncClient(); this.databaseName = dbName; } } ============结束2.CosmosHelper.java==================== ============启动3.main.java============================ package com.beginsecure; // Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, // then press Enter. You can now see whitespace characters in your code. public class Main { public static void main(String[] args) { // Press Alt+Enter with your caret at the highlighted text to see how // IntelliJ IDEA suggests fixing it. System.out.printf("Hello and welcome!"); CosmosHelper tst=new CosmosHelper("https://testdb.documents.azure.com:443/","<Synapse-Work-Space-Identity>","ToDoList"); // Press Shift+F10 or click the green arrow button in the gutter to run the code. for (int i = 1; i <= 5; i++) { // Press Shift+F9 to start debugging your code. We have set one breakpoint // for you, but you can always add more by pressing Ctrl+F8. System.out.println("i = " + i); } } } ============ 3.main.java结束============================ 使用 IntelliJ maven 运行上述项目文件时,Java 代码出现以下错误 java:com.azure.cosmos 包不存在 它应该成功运行,没有错误。 我同意你的观点,必须安装并重新加载特定 SDK 支持的所有模块才能与 Azure Cosmos DB 一起使用。 我正在尝试连接 Azure Cosmos 并尝试检索数据,但由于以下问题(编译时间)而失败。 下面是连接 Azure Cosmos DB 并从 Cosmos DB 检索数据的另一种方法。它使用 query 检索数据,如下面的输出所示。确保某些软件包及其版本在pom.xml中是否可用。 public static void main(String[] args) { CosmosClientBuilder clientBuilder = new CosmosClientBuilder() .endpoint(ENDPOINT) .key(KEY); CosmosClient cosmosClient = clientBuilder.buildClient(); CosmosDatabase cosmosDatabase = cosmosClient.getDatabase(DATABASE_NAME); CosmosContainer cosmosContainer = cosmosDatabase.getContainer(CONTAINER_NAME); String query = "SELECT * FROM c"; CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); options.setQueryMetricsEnabled(true); cosmosContainer.queryItems(query, options, CosmosItemProperties.class) .byPage() .flatMap(cosmosItemFeedResponse -> cosmosItemFeedResponse.getResults().stream()) .forEach(cosmosItemProperties -> { System.out.println(cosmosItemProperties.toJson()); }); cosmosClient.close(); } 输出: { "id": "1", "name": "Sai", "age": 10, "class": "7th", }, { "id": "2", "name": "Pavan", "age": 15, "class": "10th", }, { "id": "3", "name": "Balaji", "age": 13, "class": "8th", }

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.