Guest User

Untitled

a guest
Jan 20th, 2017
320
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. => db.properties.findOne({},{address:1})
  2. {
  3. "_id" : ObjectId("585b909c870d907845b695fd"),
  4. "address" : {
  5. "postcode" : "W1D 1NN",
  6. "address1" : "Essence",
  7. "address2" : "United Kingdom House",
  8. "county" : "London",
  9. "town" : "LONDON",
  10. "latitude" : "51.5160229933117",
  11. "longitude" : "-0.139088472429092",
  12. "house_number" : "114",
  13. "location" : {
  14. "type" : "Point",
  15. "coordinates" : [
  16. -0.139088472429092,
  17. 51.5160229933117
  18. ]
  19. }
  20. }
  21. }
  22.  
  23. => db.properties.getIndexes()
  24. [
  25. {
  26. "v" : 1,
  27. "key" : {
  28. "_id" : 1
  29. },
  30. "name" : "_id_",
  31. "ns" : "cherrydoorsync.properties"
  32. },
  33. {
  34. "v" : 1,
  35. "key" : {
  36. "address.location.coordinates" : "2d"
  37. },
  38. "name" : "address.location.coordinates_2d",
  39. "ns" : "cherrydoorsync.properties"
  40. }
  41. ]
  42.  
  43. db.propertiesSync.aggregate([
  44. {
  45. $geoNear: {
  46. near: { type: "Point", coordinates: [ -2.94379156655216, 54.8905641133194 ] },
  47. distanceField: "dist.calculated",
  48. maxDistance: 2,
  49. includeLocs: "dist.location",
  50. num: 5
  51. }
  52. }
  53. ])
  54.  
  55. assert: command failed: {
  56. "ok" : 0,
  57. "errmsg" : "geoNear command failed: { ok: 0.0, errmsg: "The featureCompatibilityVersion must be 3.4 to use collation. See http://dochub.mongodb.org/core/3.4-feature-compatibility.", code: 72, codeName: "InvalidOptions" }",
  58. "code" : 16604,
  59. "codeName" : "Location16604"
  60. } : aggregate failed
  61. _getErrorWithCode@src/mongo/shell/utils.js:25:13
  62. doassert@src/mongo/shell/assert.js:16:14
  63. assert.commandWorked@src/mongo/shell/assert.js:370:5
  64. DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1319:5
  65. @(shell):1:1
  66.  
  67. 2017-01-20T13:41:27.914+0530 E QUERY [main] Error: command failed: {
  68. "ok" : 0,
  69. "errmsg" : "geoNear command failed: { ok: 0.0, errmsg: "The featureCompatibilityVersion must be 3.4 to use collation. See http://dochub.mongodb.org/core/3.4-feature-compatibility.", code: 72, codeName: "InvalidOptions" }",
  70. "code" : 16604,
  71. "codeName" : "Location16604"
  72. } : aggregate failed :
  73. _getErrorWithCode@src/mongo/shell/utils.js:25:13
  74. doassert@src/mongo/shell/assert.js:16:14
  75. assert.commandWorked@src/mongo/shell/assert.js:370:5
  76. DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1319:5
  77. @(shell):1:1
  78.  
  79. > db.adminCommand( { setFeatureCompatibilityVersion: <"3.4" } )
  80. 2017-01-20T13:45:39.023+0530 E QUERY [main] SyntaxError: expected expression, got '<' @(shell):1:51
RAW Paste Data