gpt4 book ai didi

mongodb - 是否有 mongodb 的驱动程序可以在 .net core 应用程序中使用 Atlas 搜索?

转载 作者:行者123 更新时间:2023-12-03 15:59:15 24 4
gpt4 key购买 nike

我在我的.net core应用程序中使用MongoDB Atlas,使用c#驱动程序连接数据库,最近了解Atlas Search并且我能够为我的集合创建索引,有没有办法使用$searchbeta 从我的应用程序查询我的索引?

最佳答案

您可以使用aggregate方法和BsonDocument.Parse:

var pipeline = BsonDocument.Parse("{ $searchBeta: { search: { path: 'foo', query : 'bar' } }}");
var result = col.Aggregate<BsonDocument>(pipeline);

关于mongodb - 是否有 mongodb 的驱动程序可以在 .net core 应用程序中使用 Atlas 搜索?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60463658/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com