mongodb findOne()geojson数据

时间:2015-07-22 13:08:28

标签: json mongodb pymongo geojson

我试图通过使用mongodb的findOne函数来查找数据。但是下面的代码没有找到任何东西。

收藏:街道

代码:

db.streets.findOne({"ID":181035})

收集数据:

{
  "features": [
    {
      "type": "Feature",
      "properties": {
        "ID": 181035,
        "ADI": "Özlü Sitesi",
        "TIPI": "Ýç Yol",
        "ANNAME": null,
        "RNNAME": null,
        "ILKOD": "06",
        "ADIULUSLAR": null,
        "KKNO": null
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            32.629908,
            39.851886
          ],
          [
            32.63044,
            39.851549
          ]
        ]
      }
    }
  },
{
      "type": "Feature",
      "properties": {
        "ID": 181036,
        "ADI": "Tereci Sk.",
        "TIPI": "Sokak",
        "ANNAME": null,
        "RNNAME": null,
        "ILKOD": "06",
        "ADIULUSLAR": null,
        "KKNO": null },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            32.600541, 39.997609
          ],
          [ 
            32.599885, 39.997015
          ] 
        ] 
} },

我该怎么做? 谢谢你的帮助 注意:我编辑了收集数据

编辑:

the output of db.streets.find()

9.09654 ], [ 40.821059, 39.096993 ] ] } }, { "type" : "Feature", "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNAM
E" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626350 }, "geometry" : { "type" :
 "LineString", "coordinates" : [ [ 40.820339, 39.098164 ], [ 40.820935, 39.097766 ], [ 40.821825, 39.097231 ], [ 40.8223
32, 39.096888 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 626351, "ADI" : null, "TIPI" : "Soka
k", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null }, "geometry" : { "coordinates" : [ [ 40.82141
8, 39.098695 ], [ 40.822656, 39.097922 ] ], "type" : "LineString" } }, { "geometry" : { "type" : "LineString", "coordina
tes" : [ [ 41.045526, 38.965169 ], [ 41.045393, 38.964851 ], [ 41.045278, 38.964776 ], [ 41.045133, 38.964747 ], [ 41.04
4494, 38.965007 ], [ 41.043584, 38.965505 ] ] }, "type" : "Feature", "properties" : { "ADIULUSLAR" : null, "KKNO" : null
, "ID" : 626352, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" } }, { "type" : "Featu
re", "properties" : { "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626353, "ADI" : "314. Sk.", "TIPI" : "Sokak", "ANNAME"
: null, "RNNAME" : null, "ILKOD" : "12" }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 41.046172, 38.96514
3 ], [ 41.046146, 38.965942 ] ] } }, { "type" : "Feature", "properties" : { "ADI" : "310. Sk.", "TIPI" : "Sokak", "ANNAM
E" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626354 }, "geometry" : { "type" :
 "LineString", "coordinates" : [ [ 41.04794, 38.965247 ], [ 41.048263, 38.964615 ] ] } }, { "type" : "Feature", "propert
ies" : { "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626355, "ADI" : "PTT Cd.", "TIPI" : "Ana Arter", "AN
NAME" : "Elba?y Köyü Yolu", "RNNAME" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 41.048444, 38.9
66468 ], [ 41.047896, 38.96621 ], [ 41.047487, 38.966078 ] ] } }, { "type" : "Feature", "properties" : { "ID" : 626356,
"ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null },
"geometry" : { "type" : "LineString", "coordinates" : [ [ 41.054589, 38.97167 ], [ 41.054964, 38.97175 ], [ 41.055566, 3
8.971988 ] ] } }, { "type" : "Feature", "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : nul
l, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626357 }, "geometry" : { "type" : "LineString", "coordinat
es" : [ [ 41.05359, 38.971164 ], [ 41.053823, 38.970786 ] ] } }, { "type" : "Feature", "properties" : { "ADI" : "221/A S
k.", "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 6263
58 }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 41.057288, 38.9725 ], [ 41.057384, 38.97237 ] ] } }, { "
type" : "Feature", "properties" : { "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626359, "ADI" : "Göksu Kö
yü Yolu", "TIPI" : "Köy Yolu", "ANNAME" : null, "RNNAME" : null }, "geometry" : { "type" : "LineString", "coordinates" :
 [ [ 41.063102, 38.972598 ], [ 41.063487, 38.972889 ], [ 41.063813, 38.973438 ], [ 41.064434, 38.974265 ], [ 41.064828,
38.974906 ], [ 41.065325, 38.976046 ], [ 41.065838, 38.976917 ], [ 41.065952, 38.977168 ], [ 41.065887, 38.977606 ], [ 4
1.065941, 38.977816 ], [ 41.065958, 38.978243 ], [ 41.066079, 38.978424 ], [ 41.06626, 38.978564 ], [ 41.066577, 38.9787
66 ], [ 41.066842, 38.979069 ], [ 41.067184, 38.979808 ], [ 41.067351, 38.980182 ], [ 41.067345, 38.980509 ], [ 41.06731
7, 38.980778 ], [ 41.06705, 38.981549 ], [ 41.066932, 38.982029 ], [ 41.066979, 38.982268 ], [ 41.067062, 38.982379 ], [
 41.06719, 38.982402 ], [ 41.06795, 38.982418 ], [ 41.068634, 38.982398 ], [ 41.068791, 38.982339 ], [ 41.069058, 38.982
024 ], [ 41.069514, 38.981602 ], [ 41.069814, 38.981449 ], [ 41.070121, 38.981331 ], [ 41.070362, 38.981336 ], [ 41.0706
33, 38.981394 ], [ 41.071349, 38.981551 ], [ 41.071959, 38.981783 ], [ 41.072163, 38.981894 ], [ 41.072261, 38.981969 ],
 [ 41.072277, 38.98208 ], [ 41.072118, 38.982482 ], [ 41.071969, 38.982641 ], [ 41.07173, 38.982881 ], [ 41.071596, 38.9
83209 ], [ 41.07156, 38.983413 ], [ 41.071606, 38.983606 ], [ 41.072226, 38.984308 ], [ 41.072521, 38.984664 ], [ 41.072
589, 38.984739 ], [ 41.072747, 38.984739 ], [ 41.073153, 38.984662 ], [ 41.0735, 38.984602 ], [ 41.073696, 38.984607 ],
[ 41.073937, 38.984706 ], [ 41.074178, 38.98481 ], [ 41.074686, 38.98489 ], [ 41.074964, 38.98493 ], [ 41.075167, 38.984
906 ], [ 41.075792, 38.984719 ], [ 41.076655, 38.984406 ], [ 41.077119, 38.984181 ], [ 41.077178, 38.984093 ], [ 41.0772
3, 38.983918 ], [ 41.07735, 38.983806 ], [ 41.078069, 38.983537 ], [ 41.078204, 38.983466 ], [ 41.078753, 38.983464 ], [
 41.079031, 38.983475 ], [ 41.079628, 38.983346 ], [ 41.080109, 38.98328 ], [ 41.080349, 38.983291 ], [ 41.080508, 38.98
3337 ], [ 41.080772, 38.9835 ], [ 41.080983, 38.983684 ], [ 41.081067, 38.983871 ], [ 41.081166, 38.984163 ], [ 41.08125
7, 38.984285 ], [ 41.081378, 38.984477 ], [ 41.081446, 38.984719 ], [ 41.081388, 38.984976 ], [ 41.081351, 38.985181 ],
[ 41.081367, 38.985286 ], [ 41.081459, 38.985601 ], [ 41.081453, 38.985887 ], [ 41.081441, 38.986415 ], [ 41.08139, 38.9
8669 ], [ 41.081256, 38.986901 ], [ 41.080648, 38.987702 ], [ 41.080484, 38.987972 ], [ 41.08041, 38.988211 ], [ 41.0802
99, 38.988387 ], [ 41.080082, 38.988604 ], [ 41.079577, 38.989101 ], [ 41.079428, 38.989388 ], [ 41.079241, 38.989605 ],
 [ 41.079197, 38.98985 ], [ 41.079205, 38.990459 ], [ 41.079153, 38.990629 ], [ 41.079071, 38.990711 ], [ 41.078966, 38.
99077 ], [ 41.078794, 38.990852 ], [ 41.078546, 38.990888 ], [ 41.078161, 38.990985 ], [ 41.077561, 38.991215 ], [ 41.07
7321, 38.991356 ], [ 41.077021, 38.991544 ], [ 41.076864, 38.991673 ], [ 41.076726, 38.992055 ], [ 41.076721, 38.992347
], [ 41.076782, 38.992523 ], [ 41.076979, 38.992891 ], [ 41.077041, 38.993171 ], [ 41.07705, 38.993381 ], [ 41.07705, 38
.993504 ], [ 41.077126, 38.993545 ], [ 41.077208, 38.993544 ], [ 41.077632, 38.993368 ], [ 41.078166, 38.993249 ], [ 41.
078459, 38.993219 ], [ 41.078647, 38.993224 ], [ 41.078943, 38.993346 ], [ 41.079184, 38.993503 ], [ 41.079358, 38.99357
2 ], [ 41.079967, 38.99361 ], [ 41.080283, 38.99365 ], [ 41.080472, 38.993772 ], [ 41.080653, 38.993912 ], [ 41.080781,
38.993917 ], [ 41.081201, 38.993869 ], [ 41.081352, 38.993916 ], [ 41.081616, 38.994078 ], [ 41.082056, 38.994468 ], [ 4
1.08223, 38.994748 ], [ 41.082397, 38.995057 ], [ 41.082511, 38.995226 ], [ 41.082782, 38.995336 ], [ 41.083324, 38.9954
 ], [ 41.083813, 38.995399 ], [ 41.084339, 38.99535 ], [ 41.084646, 38.995285 ], [ 41.084931, 38.995149 ], [ 41.085226,
38.994921 ], [ 41.085496, 38.994756 ], [ 41.085669, 38.994726 ], [ 41.085752, 38.994749 ], [ 41.085902, 38.994778 ], [ 4
1.085955, 38.994825 ], [ 41.08622, 38.995415 ], [ 41.086289, 38.995625 ], [ 41.086283, 38.995777 ], [ 41.086245, 38.9958
3 ], [ 41.086126, 38.99593 ], [ 41.085908, 38.99603 ], [ 41.085781, 38.996129 ], [ 41.085729, 38.996252 ], [ 41.08573, 3
8.996387 ], [ 41.085791, 38.996527 ], [ 41.086176, 38.996909 ], [ 41.086328, 38.997143 ], [ 41.086539, 38.997329 ], [ 41
.08654, 38.997387 ], [ 41.086495, 38.997417 ], [ 41.086442, 38.997417 ], [ 41.086269, 38.997277 ], [ 41.085751, 38.99692
 ], [ 41.085548, 38.996827 ], [ 41.085322, 38.996769 ], [ 41.085149, 38.996758 ], [ 41.084888, 38.996673 ], [ 41.084632,
 38.996604 ], [ 41.084211, 38.996611 ], [ 41.083994, 38.996688 ], [ 41.083626, 38.9968 ], [ 41.082819, 38.996942 ], [ 41
.082578, 38.99696 ], [ 41.08239, 38.99692 ], [ 41.08166, 38.996791 ], [ 41.081389, 38.996856 ], [ 41.080932, 38.997045 ]
, [ 41.080684, 38.997116 ], [ 41.080572, 38.997169 ], [ 41.08052, 38.997257 ], [ 41.080505, 38.997408 ], [ 41.080552, 38
.997642 ], [ 41.080696, 38.997848 ], [ 41.080914, 38.997946 ], [ 41.081073, 38.998109 ], [ 41.081157, 38.998232 ], [ 41.
081438, 38.998439 ], [ 41.081507, 38.998538 ], [ 41.081545, 38.998684 ], [ 41.081592, 38.999075 ], [ 41.081623, 38.99926
2 ], [ 41.081828, 38.999558 ], [ 41.081957, 38.999821 ], [ 41.082116, 38.999949 ], [ 41.082402, 39.000012 ], [ 41.082858
, 39.000117 ], [ 41.082994, 39.000175 ], [ 41.08316, 39.000321 ], [ 41.083282, 39.000519 ], [ 41.083343, 39.000776 ], [
41.083443, 39.001132 ], [ 41.083632, 39.001381 ], [ 41.084028, 39.001837 ], [ 41.084218, 39.002081 ], [ 41.084528, 39.00
2519 ], [ 41.084786, 39.002894 ], [ 41.084817, 39.003081 ], [ 41.084826, 39.00332 ], [ 41.084828, 39.00356 ], [ 41.08485
1, 39.003747 ], [ 41.084814, 39.003846 ], [ 41.084484, 39.004189 ], [ 41.084087, 39.004482 ], [ 41.083757, 39.004729 ],
[ 41.083518, 39.00487 ], [ 41.083338, 39.004946 ], [ 41.083052, 39.005023 ], [ 41.082624, 39.005093 ], [ 41.082436, 39.0
05122 ], [ 41.082324, 39.00514 ], [ 41.082248, 39.005129 ], [ 41.082143, 39.005082 ], [ 41.081872, 39.004972 ], [ 41.081
601, 39.004938 ], [ 41.081496, 39.004914 ], [ 41.081338, 39.004833 ], [ 41.081104, 39.004781 ], [ 41.080976, 39.004782 ]
, [ 41.080886, 39.004817 ], [ 41.080804, 39.004876 ], [ 41.080689, 39.005585 ], [ 41.080667, 39.005825 ], [ 41.080646, 3
9.006012 ], [ 41.080654, 39.006164 ], [ 41.080828, 39.00635 ], [ 41.080911, 39.006438 ], [ 41.080995, 39.006583 ], [ 41.
080981, 39.00677 ], [ 41.080794, 39.007011 ], [ 41.080648, 39.007293 ], [ 41.080633, 39.007322 ], [ 41.080626, 39.007433
 ], [ 41.080725, 39.007643 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 626360, "ADI" : "Göksu
Köyü Yolu", "TIPI" : "Ana Arter", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null }, "geometry" :
{ "coordinates" : [ [ 41.061722, 38.971056 ], [ 41.061778, 38.971552 ], [ 41.061819, 38.971682 ], [ 41.061919, 38.971797
 ] ], "type" : "LineString" } }, { "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.475426, 39.227438 ], [ 4
0.474938, 39.227207 ], [ 40.474594, 39.227076 ], [ 40.474349, 39.227001 ], [ 40.473977, 39.226934 ], [ 40.473625, 39.226
885 ], [ 40.473295, 39.226878 ], [ 40.472703, 39.226956 ], [ 40.472454, 39.226977 ], [ 40.472329, 39.226964 ], [ 40.4722
43, 39.226893 ], [ 40.472187, 39.226753 ], [ 40.472151, 39.226667 ], [ 40.472115, 39.22622 ], [ 40.472137, 39.225756 ],
[ 40.472112, 39.225248 ], [ 40.472221, 39.224864 ], [ 40.472631, 39.223516 ], [ 40.472674, 39.223288 ], [ 40.472695, 39.
222954 ], [ 40.472601, 39.222677 ], [ 40.472368, 39.222258 ], [ 40.472196, 39.222053 ], [ 40.471677, 39.221677 ], [ 40.4
71252, 39.221426 ] ] }, "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 626361, "ADI" : null, "TIPI" : "Köy Y
olu", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null } }, { "properties" : { "TIPI" : "Sokak", "A
NNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 626362, "ADI" : null }, "geom
etry" : { "type" : "LineString", "coordinates" : [ [ 40.989528, 38.833954 ], [ 40.989781, 38.833986 ], [ 40.989905, 38.8
34174 ], [ 40.990157, 38.834476 ], [ 40.990322, 38.834709 ], [ 40.990551, 38.83491 ] ] }, "type" : "Feature" }, { "type"
 : "Feature", "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULU
SLAR" : null, "KKNO" : null, "ID" : 626363 }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.697067, 38.77
7153 ], [ 40.697214, 38.776993 ], [ 40.697396, 38.776906 ], [ 40.697643, 38.776842 ], [ 40.697737, 38.776774 ], [ 40.697
772, 38.776563 ], [ 40.697901, 38.776265 ] ] } }, { "type" : "Feature", "properties" : { "ADIULUSLAR" : null, "KKNO" : n
ull, "ID" : 626364, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" }, "geometry" : { "
type" : "LineString", "coordinates" : [ [ 40.864204, 38.781086 ], [ 40.864427, 38.781139 ], [ 40.864615, 38.781242 ], [
40.864833, 38.781425 ], [ 40.864965, 38.781471 ], [ 40.865132, 38.781489 ], [ 40.865382, 38.781457 ], [ 40.865664, 38.78
1363 ] ] } }, { "type" : "Feature", "properties" : { "ID" : 1017602, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "R
NNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null }, "geometry" : { "type" : "LineString", "coordinates"
 : [ [ 40.485545, 38.888173 ], [ 40.485463, 38.88826 ], [ 40.484752, 38.888655 ], [ 40.483754, 38.889281 ], [ 40.483104,
 38.889681 ], [ 40.482937, 38.88976 ], [ 40.482665, 38.889864 ], [ 40.482419, 38.889951 ], [ 40.482249, 38.890004 ], [ 4
0.482099, 38.890025 ], [ 40.481994, 38.890023 ], [ 40.481875, 38.889991 ], [ 40.481841, 38.889943 ], [ 40.481841, 38.889
88 ], [ 40.481902, 38.889718 ], [ 40.481987, 38.889615 ], [ 40.482082, 38.889525 ], [ 40.482191, 38.889424 ] ] } }, { "t
ype" : "Feature", "properties" : { "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null,
 "ID" : 2467157, "ADI" : null, "TIPI" : "Sokak" }, "geometry" : { "coordinates" : [ [ 40.518116, 39.170552 ], [ 40.51795
7, 39.170561 ], [ 40.517828, 39.170533 ], [ 40.51771, 39.170479 ], [ 40.517587, 39.170424 ], [ 40.517575, 39.170169 ], [
 40.517405, 39.17001 ], [ 40.517141, 39.169823 ], [ 40.517006, 39.169718 ], [ 40.516712, 39.169463 ], [ 40.516559, 39.16
9318 ] ], "type" : "LineString" } }, { "type" : "Feature", "properties" : { "TIPI" : "Sokak", "ANNAME" : null, "RNNAME"
: null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 2467158, "ADI" : null }, "geometry" : { "type" : "Lin
eString", "coordinates" : [ [ 40.556704, 38.913765 ], [ 40.556804, 38.913323 ], [ 40.558376, 38.91361 ] ] } }, { "type"
: "Feature", "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUS
LAR" : null, "KKNO" : null, "ID" : 2467159 }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.559784, 38.90
9835 ], [ 40.559526, 38.910415 ] ] } }, { "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.327183, 39.148992
 ], [ 40.327353, 39.149046 ], [ 40.327617, 39.149165 ], [ 40.32791, 39.149215 ], [ 40.327992, 39.149301 ], [ 40.328015,
39.149528 ], [ 40.328033, 39.149655 ], [ 40.328133, 39.149764 ], [ 40.32822, 39.149964 ], [ 40.328472, 39.150273 ], [ 40
.328736, 39.150573 ], [ 40.328871, 39.150819 ], [ 40.32907, 39.15096 ], [ 40.329281, 39.151114 ] ] }, "type" : "Feature"
, "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null
, "KKNO" : null, "ID" : 2467160 } }, { "type" : "Feature", "properties" : { "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO"
: null, "ID" : 2473883, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null }, "geometry" : { "type" : "Lin
eString", "coordinates" : [ [ 40.921059, 38.846083 ], [ 40.920895, 38.845805 ], [ 40.920884, 38.845691 ], [ 40.921083, 3
8.845627 ], [ 40.92137, 38.8457 ], [ 40.921823, 38.845966 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null,
 "ID" : 2973164, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null }
, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.861224, 39.132998 ], [ 40.861658, 39.133872 ], [ 40.86199
8, 39.134327 ], [ 40.862866, 39.1349 ], [ 40.863886, 39.135664 ], [ 40.86432, 39.136028 ], [ 40.86452, 39.136728 ], [ 40
.864859, 39.137262 ] ] } }, { "type" : "Feature", "properties" : { "ADI" : "Alynyazy Köyü Yç Yolu", "TIPI" : "Sokak", "A
NNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 2973165 }, "geometry" : { "ty
pe" : "LineString", "coordinates" : [ [ 40.15405, 39.254728 ], [ 40.154114, 39.254681 ], [ 40.154167, 39.254681 ], [ 40.
154253, 39.254737 ], [ 40.154342, 39.254868 ], [ 40.1544, 39.255025 ], [ 40.154383, 39.255147 ], [ 40.154375, 39.255216
], [ 40.1544, 39.255298 ], [ 40.154439, 39.255371 ], [ 40.154461, 39.255425 ], [ 40.154622, 39.255515 ], [ 40.154639, 39
.255562 ], [ 40.154631, 39.255605 ], [ 40.154619, 39.255657 ], [ 40.154647, 39.255721 ], [ 40.154886, 39.255988 ], [ 40.
154994, 39.256102 ], [ 40.154994, 39.256183 ], [ 40.155, 39.256241 ], [ 40.155152, 39.256411 ], [ 40.155427, 39.256628 ]
, [ 40.155586, 39.25677 ], [ 40.155638, 39.256925 ], [ 40.155727, 39.257116 ], [ 40.15583, 39.257196 ], [ 40.155996, 39.
257239 ], [ 40.156319, 39.25725 ], [ 40.156643, 39.257258 ], [ 40.157015, 39.257183 ], [ 40.157271, 39.257134 ], [ 40.15
7376, 39.257119 ], [ 40.157423, 39.257076 ], [ 40.157451, 39.256972 ], [ 40.157362, 39.25679 ] ] } }, { "type" : "Featur
e", "properties" : { "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : n
ull, "ID" : 2973166, "ADI" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.729122, 38.764657 ], [
 40.728726, 38.764962 ], [ 40.728702, 38.765075 ], [ 40.728737, 38.765344 ], [ 40.728918, 38.766075 ], [ 40.728978, 38.7
66282 ] ] } }, { "type" : "Feature", "properties" : { "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : nul
l, "ID" : 2997672, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null }, "geometry" : { "type" : "LineString", "coordinates
" : [ [ 40.310523, 39.158484 ], [ 40.31037, 39.158566 ], [ 40.310118, 39.158621 ], [ 40.30982, 39.158602 ], [ 40.309644,
 39.158525 ], [ 40.309468, 39.158416 ], [ 40.309327, 39.158375 ], [ 40.309128, 39.158084 ], [ 40.30902, 39.157876 ] ] }
}, { "properties" : { "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : "12-79", "ID" : 3032869, "ADI" : "Ky?y Sancak Yolu",
 "TIPI" : "Yl Yolu", "ANNAME" : null, "RNNAME" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.36
9698, 39.293899 ], [ 40.369744, 39.294141 ], [ 40.369663, 39.294392 ], [ 40.36951, 39.294499 ] ] }, "type" : "Feature" }
, { "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.370564, 39.293904 ], [ 40.370833, 39.293208 ], [ 40.371
004, 39.292665 ], [ 40.370999, 39.292551 ], [ 40.37098, 39.292464 ] ] }, "type" : "Feature", "properties" : { "ID" : 303
2870, "ADI" : null, "TIPI" : "Köy Yolu", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" :
 null } }, { "type" : "Feature", "properties" : { "ADIULUSLAR" : null, "KKNO" : null, "ID" : 3035481, "ADI" : "Yayladere
 Köyü Yç Yolu", "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" }, "geometry" : { "type" : "LineStrin
g", "coordinates" : [ [ 40.099468, 39.211193 ], [ 40.099685, 39.211193 ], [ 40.099835, 39.211207 ], [ 40.100111, 39.2113
31 ], [ 40.100455, 39.21182 ], [ 40.1004, 39.212039 ] ] } }, { "type" : "Feature", "properties" : { "ADIULUSLAR" : null,
 "KKNO" : null, "ID" : 3035482, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" }, "geo
metry" : { "type" : "LineString", "coordinates" : [ [ 40.383141, 39.044916 ], [ 40.382479, 39.044162 ], [ 40.383053, 39.
043771 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 3035483, "ADI" : "Batyayaz Köyü Yç Yolu", "
TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null }, "geometry" : { "type" : "LineS
tring", "coordinates" : [ [ 40.098796, 39.206413 ], [ 40.099456, 39.206933 ], [ 40.099845, 39.207099 ], [ 40.10007, 39.2
07133 ], [ 40.100239, 39.207125 ], [ 40.10038, 39.207029 ], [ 40.100369, 39.206566 ], [ 40.100166, 39.20626 ], [ 40.0999
8, 39.205897 ], [ 40.099985, 39.205779 ], [ 40.100234, 39.205539 ], [ 40.100228, 39.205395 ], [ 40.100098, 39.205185 ],
[ 40.099839, 39.20491 ], [ 40.099816, 39.204744 ], [ 40.099811, 39.204613 ], [ 40.099935, 39.20453 ], [ 40.100279, 39.20
4491 ], [ 40.100521, 39.204495 ], [ 40.100809, 39.204578 ], [ 40.100949, 39.204696 ], [ 40.101, 39.20484 ], [ 40.101107,
 39.205474 ], [ 40.10122, 39.205605 ], [ 40.101305, 39.20564 ], [ 40.101417, 39.205644 ], [ 40.101823, 39.20557 ], [ 40.
101998, 39.205657 ], [ 40.102385, 39.205801 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 303548
4, "ADI" : "Güne?lik Köyü Yç Yolu", "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : n
ull }, "geometry" : { "coordinates" : [ [ 40.163466, 39.205108 ], [ 40.163302, 39.205042 ], [ 40.163193, 39.204883 ], [
40.163131, 39.204741 ] ], "type" : "LineString" } }, { "type" : "Feature", "properties" : { "ILKOD" : "12", "ADIULUSLAR"
 : null, "KKNO" : null, "ID" : 3035485, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null }, "geometry" :
 { "type" : "LineString", "coordinates" : [ [ 40.726624, 38.657383 ], [ 40.726799, 38.657337 ], [ 40.726987, 38.657063 ]
, [ 40.726957, 38.656931 ], [ 40.726864, 38.656766 ], [ 40.726887, 38.656638 ], [ 40.727133, 38.656296 ], [ 40.727004, 3
8.656013 ], [ 40.726665, 38.655821 ], [ 40.726332, 38.655634 ], [ 40.726162, 38.65557 ], [ 40.725858, 38.655483 ], [ 40.
725665, 38.655433 ] ] } }, { "type" : "Feature", "properties" : { "ID" : 3035486, "ADI" : null, "TIPI" : "Sokak", "ANNAM
E" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null }, "geometry" : { "type" : "LineString",
"coordinates" : [ [ 40.791955, 39.051407 ], [ 40.791758, 39.051526 ], [ 40.791491, 39.051705 ], [ 40.791273, 39.051905 ]
, [ 40.79105, 39.051987 ], [ 40.790956, 39.052076 ], [ 40.790899, 39.052203 ], [ 40.790852, 39.052366 ], [ 40.790873, 39
.052622 ] ] } }, { "properties" : { "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : n
ull, "KKNO" : null, "ID" : 3035487, "ADI" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.713768,
 38.931823 ], [ 40.71288, 38.931883 ], [ 40.712827, 38.931681 ], [ 40.712728, 38.931206 ] ] }, "type" : "Feature" }, { "
type" : "Feature", "properties" : { "ADIULUSLAR" : null, "KKNO" : null, "ID" : 3035488, "ADI" : null, "TIPI" : "Sokak",
"ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.320627,
 39.180092 ], [ 40.320551, 39.18014 ], [ 40.320334, 39.180349 ], [ 40.319926, 39.180651 ], [ 40.319683, 39.180806 ], [ 4
0.319548, 39.180924 ], [ 40.31946, 39.181174 ] ] } }, { "type" : "Feature", "properties" : { "ADIULUSLAR" : null, "KKNO"
 : null, "ID" : 3035489, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12" }, "geometry"
: { "type" : "LineString", "coordinates" : [ [ 41.013094, 39.300213 ], [ 41.013126, 39.30029 ], [ 41.013162, 39.300358 ]
, [ 41.013194, 39.300387 ], [ 41.013279, 39.300448 ], [ 41.013332, 39.30053 ], [ 41.013435, 39.300736 ] ] } }, { "type"
: "Feature", "properties" : { "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID"
 : 3035490, "ADI" : null, "TIPI" : "Sokak" }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.346906, 39.27
4368 ], [ 40.347822, 39.274421 ] ] } }, { "type" : "Feature", "properties" : { "KKNO" : null, "ID" : 3035491, "ADI" : nu
ll, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null }, "geometry" : { "coordinat
es" : [ [ 40.458483, 39.19359 ], [ 40.458004, 39.193804 ], [ 40.458014, 39.194495 ] ], "type" : "LineString" } }, { "typ
e" : "Feature", "properties" : { "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null
, "KKNO" : null, "ID" : 3035492, "ADI" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.570258, 38
.860476 ], [ 40.569953, 38.860458 ], [ 40.569941, 38.859764 ], [ 40.569894, 38.859216 ], [ 40.569938, 38.85897 ], [ 40.5
70026, 38.858755 ], [ 40.570179, 38.858623 ], [ 40.570396, 38.858568 ], [ 40.570571, 38.85839 ], [ 40.570548, 38.858235
] ] } }, { "properties" : { "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 3035493, "ADI" : null, "TIPI" : "
Sokak", "ANNAME" : null, "RNNAME" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.322853, 38.6485
07 ], [ 40.32262, 38.648352 ], [ 40.322287, 38.64827 ], [ 40.321907, 38.648247 ], [ 40.321674, 38.64827 ], [ 40.321376,
38.648356 ], [ 40.321125, 38.648457 ], [ 40.320845, 38.64873 ], [ 40.32057, 38.64899 ] ] }, "type" : "Feature" }, { "typ
e" : "Feature", "properties" : { "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null
, "KKNO" : null, "ID" : 3035494, "ADI" : "Korlu Köyü Yç Yolu" }, "geometry" : { "type" : "LineString", "coordinates" : [
 [ 40.158065, 39.178592 ], [ 40.158193, 39.178437 ], [ 40.158205, 39.178382 ], [ 40.158164, 39.178351 ], [ 40.158067, 39
.178328 ], [ 40.157783, 39.178333 ], [ 40.157513, 39.17834 ] ] } }, { "type" : "Feature", "properties" : { "ID" : 303677
9, "ADI" : "Güne?lik Köyü Yç Yolu", "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : n
ull, "KKNO" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.181175, 39.198032 ], [ 40.181558, 39.
198224 ], [ 40.181986, 39.198312 ], [ 40.182301, 39.198312 ], [ 40.182279, 39.198207 ], [ 40.181941, 39.198137 ], [ 40.1
81693, 39.197945 ], [ 40.181535, 39.197631 ], [ 40.181564, 39.19742 ] ] } }, { "type" : "Feature", "properties" : { "ADI
ULUSLAR" : null, "KKNO" : null, "ID" : 3036780, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD
" : "12" }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.603056, 38.914118 ], [ 40.603261, 38.913826 ],
[ 40.603642, 38.913288 ], [ 40.603378, 38.913142 ], [ 40.602933, 38.912964 ] ] } }, { "properties" : { "ILKOD" : "12", "
ADIULUSLAR" : null, "KKNO" : null, "ID" : 3036781, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null }, "
geometry" : { "type" : "LineString", "coordinates" : [ [ 40.596264, 38.887096 ], [ 40.59622, 38.887023 ], [ 40.596261, 3
8.886938 ], [ 40.596611, 38.886769 ] ] }, "type" : "Feature" }, { "geometry" : { "type" : "LineString", "coordinates" :
[ [ 40.556896, 38.909244 ], [ 40.55693, 38.909345 ], [ 40.556882, 38.910588 ], [ 40.556752, 38.911034 ] ] }, "type" : "F
eature", "properties" : { "ID" : 3036782, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "1
2", "ADIULUSLAR" : null, "KKNO" : null } }, { "type" : "Feature", "properties" : { "ADI" : null, "TIPI" : "Sokak", "ANNA
ME" : null, "RNNAME" : null, "ILKOD" : "12", "ADIULUSLAR" : null, "KKNO" : null, "ID" : 3036783 }, "geometry" : { "type"
 : "LineString", "coordinates" : [ [ 40.329103, 38.934753 ], [ 40.328974, 38.934794 ], [ 40.328662, 38.935022 ], [ 40.32
8692, 38.935102 ], [ 40.328865, 38.935292 ], [ 40.328947, 38.935516 ], [ 40.329041, 38.935685 ], [ 40.329159, 38.935763
], [ 40.329368, 38.9358 ], [ 40.32955, 38.935804 ], [ 40.329732, 38.935759 ], [ 40.32985, 38.935715 ], [ 40.329926, 38.9
35695 ], [ 40.330026, 38.935738 ] ] } }, { "geometry" : { "type" : "LineString", "coordinates" : [ [ 40.627713, 38.96098
2 ], [ 40.627604, 38.961023 ], [ 40.627384, 38.961037 ], [ 40.627298, 38.961002 ], [ 40.62711, 38.960993 ], [ 40.62689,
38.961037 ], [ 40.626728, 38.961105 ], [ 40.626549, 38.961133 ], [ 40.626396, 38.961137 ] ] }, "type" : "Feature", "prop
erties" : { "KKNO" : null, "ID" : 3036784, "ADI" : null, "TIPI" : "Sokak", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "
12", "ADIULUSLAR" : null } }, { "type" : "Feature", "properties" : { 

输出不完整它有比这更多的数据,但我只能复制这个

1 个答案:

答案 0 :(得分:0)

由于IDproperties中的字段,而且这是features数组中的元素之一,您必须使用

$elemMatch

db.streets.find( { features: { $elemMatch: { "properties.ID": 181035 } } } )

样品:

我有这个集合

> db.fea.find()
{ "_id" : ObjectId("55af9d72a894779dc40208e9"), "features" : [ { "type" : "Feature", "properties" : { "ID" : 181035, "ADI" : "si", "TIPI" : "sl", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "06", "ADIULUSLAR" : null, "KKNO" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 32.629908, 39.851886 ], [ 32.63044, 39.851549 ] ] } } ] }
{ "_id" : ObjectId("55af9d93a894779dc40208ea"), "features" : [ { "type" : "Feature", "properties" : { "ID" : 181034, "ADI" : "si", "TIPI" : "sl", "ANNAME" : null, "RNNAME" : null, "ILKOD" : "06", "ADIULUSLAR" : null, "KKNO" : null }, "geometry" : { "type" : "LineString", "coordinates" : [ [ 32.629908, 39.851886 ], [ 32.63044, 39.851549 ] ] } } ] }

查询结果

> db.fea.findOne( { features: { $elemMatch: { "properties.ID": 181035 } } } )
{
    "_id" : ObjectId("55af9d72a894779dc40208e9"),
    "features" : [
        {
            "type" : "Feature",
            "properties" : {
                "ID" : 181035,
                "ADI" : "si",
                "TIPI" : "sl",
                "ANNAME" : null,
                "RNNAME" : null,
                "ILKOD" : "06",
                "ADIULUSLAR" : null,
                "KKNO" : null
            },
            "geometry" : {
                "type" : "LineString",
                "coordinates" : [
                    [
                        32.629908,
                        39.851886
                    ],
                    [
                        32.63044,
                        39.851549
                    ]
                ]
            }
        }
    ]
}