MongoDB罗盘查询
MongoDB compass Query
我有这样的数据
{
"_id": {
"$oid": "61cc17d0e465f648b6d3da61"
},
"Level": "Error",
"UtcTimeStamp": {
"$date": "2021-12-29T08:09:52.191Z"
},
"MessageTemplate": {
"Text": "İşlem sırasında bir hata oluştu!",
"Tokens": [{
"_t": "TextToken",
"StartIndex": 0,
"Text": "İşlem sırasında bir hata oluştu!"
}]
},
"RenderedMessage": "İşlem sırasında bir hata oluştu!",
"Properties": {
"EventId": {
"Id": 5001
},
"SourceContext": "NotificationController",
"ActionId": "9567ad03-89d0-4de9-986e-0432ea30b964",
"ActionName": "AcerPlatformV2.Presentation.Controllers.NotificationController.GetNotificationById (AcerPlatformV2.Presentation)",
"RequestId": "800081d9-0000-f600-b63f-84710c7967bb",
"RequestPath": "/GetNotificationById",
"ApplicationName": "WebUI"
},
"Exception": {
"_t": "FormatException",
"HelpLink": null,
"Source": "System.Private.CoreLib",
"HResult": -2146233033,
"Message": "Input string was not in a correct format.",
"StackTrace": " at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)\r\n at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)\r\n at System.Convert.ToInt32(String value)\r\n at AcerPlatformV2.Presentation.Controllers.NotificationController.GetNotificationById(String id, String notificationType) in C:\BuildAgent\_work\5\s\AcerPlatformV2.Presentation\Controllers\NotificationController.cs:line 106\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)",
"Data": {}
}
}
我想在 MongoDB compass 中过滤具有所需 RequestID 的数据。
其实我不知道如何检索具有所需 RequestId 的数据。
db.collection.find({
"Properties.RequestId" : "800081d9-0000-f600-b63f-84710c7967bb"
})
这是简单的查找命令。但不是关键部分的引号和句号(.)。
在罗盘中,您需要在查询文本区域中提供以下内容。
{ "Properties.RequestId" : "800081d9-0000-f600-b63f-84710c7967bb" }
我有这样的数据
{
"_id": {
"$oid": "61cc17d0e465f648b6d3da61"
},
"Level": "Error",
"UtcTimeStamp": {
"$date": "2021-12-29T08:09:52.191Z"
},
"MessageTemplate": {
"Text": "İşlem sırasında bir hata oluştu!",
"Tokens": [{
"_t": "TextToken",
"StartIndex": 0,
"Text": "İşlem sırasında bir hata oluştu!"
}]
},
"RenderedMessage": "İşlem sırasında bir hata oluştu!",
"Properties": {
"EventId": {
"Id": 5001
},
"SourceContext": "NotificationController",
"ActionId": "9567ad03-89d0-4de9-986e-0432ea30b964",
"ActionName": "AcerPlatformV2.Presentation.Controllers.NotificationController.GetNotificationById (AcerPlatformV2.Presentation)",
"RequestId": "800081d9-0000-f600-b63f-84710c7967bb",
"RequestPath": "/GetNotificationById",
"ApplicationName": "WebUI"
},
"Exception": {
"_t": "FormatException",
"HelpLink": null,
"Source": "System.Private.CoreLib",
"HResult": -2146233033,
"Message": "Input string was not in a correct format.",
"StackTrace": " at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)\r\n at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)\r\n at System.Convert.ToInt32(String value)\r\n at AcerPlatformV2.Presentation.Controllers.NotificationController.GetNotificationById(String id, String notificationType) in C:\BuildAgent\_work\5\s\AcerPlatformV2.Presentation\Controllers\NotificationController.cs:line 106\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)",
"Data": {}
}
}
我想在 MongoDB compass 中过滤具有所需 RequestID 的数据。 其实我不知道如何检索具有所需 RequestId 的数据。
db.collection.find({
"Properties.RequestId" : "800081d9-0000-f600-b63f-84710c7967bb"
})
这是简单的查找命令。但不是关键部分的引号和句号(.)。
在罗盘中,您需要在查询文本区域中提供以下内容。
{ "Properties.RequestId" : "800081d9-0000-f600-b63f-84710c7967bb" }