没有查询的搜索返回一些文档。然后我尝试通过字段值查询其中一个文档,但查询没有返回任何内容:'
> db.packageData.find( { },{data : 0} ).limit(2).pretty()
{
"_id" : "RB#0122SS01CT1_20221024_164223_00116723.xml_1666644148902",
"filename" : "0122SS01CT1_20221024_164223_00116723.xml",
"p_uid" : "0122SS01CT1_20221024_164223_00116723",
"tunnelPackageId" : NumberLong(116723),
"userId" : "RB",
"contentType" : "CAMERA_XML",
"length" : 13652,
"uploadDate" : ISODate("2022-10-24T20:42:28.902Z"),
"forwardDate" : ISODate("2022-10-24T20:42:28.903Z"),
"forwarded" : false
}
{
"_id" : "TOP#0122SS01CT1_20221024_164225_00116726_3.jpg_1666644148991",
"filename" : "0122SS01CT1_20221024_164225_00116726_3.jpg",
"p_uid" : "0122SS01CT1_20221024_164225_00116726",
"tunnelPackageId" : NumberLong(116726),
"userId" : "TOP",
"contentType" : "THUMBNAIL_IMAGE",
"length" : 34556,
"uploadDate" : ISODate("2022-10-24T20:42:28.991Z"),
"forwardDate" : ISODate("2022-10-24T20:42:28.991Z"),
"forwarded" : false
}
> db.packageData.find( { "filename" : "0122SS01CT1_20221024_164223_00116723.xml" },{data : 0} ).pretty()
>
谢谢你的建议!'我试着转义文件名值中的.””,但得到了相同的结果。
1条答案
按热度按时间llycmphe1#
你做错了什么,看看我为你的数据得到的输出: