Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mongo bundles

  • Loading branch information...
commit b01b8202dc25797cee6b05e0a23edf0d9253655c 1 parent a9c101a
Anatoliy Chakkaev authored
Showing with 38,426 additions and 0 deletions.
  1. +1 −0  node_modules/.npm/.cache/connect-mongo/.cache.json
  2. +1 −0  node_modules/.npm/.cache/connect-mongo/0.1.1/.cache.json
  3. +39 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package.json
  4. BIN  node_modules/.npm/.cache/connect-mongo/0.1.1/package.tgz
  5. +3 −0  node_modules/.npm/.cache/connect-mongo/0.1.1/package/.npmignore
  6. +10 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package/History.md
  7. +5 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package/Makefile
  8. +67 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package/Readme.md
  9. +2 −0  node_modules/.npm/.cache/connect-mongo/0.1.1/package/index.js
  10. +145 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package/lib/connect-mongo.js
  11. +13 −0 node_modules/.npm/.cache/connect-mongo/0.1.1/package/package.json
  12. +1 −0  node_modules/.npm/.cache/connect-mongodb/.cache.json
  13. +1 −0  node_modules/.npm/.cache/connect-mongodb/0.3.0/.cache.json
  14. +40 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package.json
  15. BIN  node_modules/.npm/.cache/connect-mongodb/0.3.0/package.tgz
  16. +57 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/Readme.md
  17. +64 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/examples/index.js
  18. +1 −0  node_modules/.npm/.cache/connect-mongodb/0.3.0/package/index.js
  19. +210 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/lib/connect-mongodb.js
  20. +10 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/package.json
  21. +47 −0 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/test/index.js
  22. +1 −0  node_modules/.npm/.cache/mongodb/.cache.json
  23. +1 −0  node_modules/.npm/.cache/mongodb/0.9.4-3/.cache.json
  24. +90 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package.json
  25. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package.tgz
  26. +6 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/.gitignore
  27. +7 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/HISTORY
  28. +26 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/Makefile
  29. +377 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/Readme.md
  30. +34 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/benchmark/grid_fs_write_benchmark.js
  31. +47 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/benchmark/streaming_benchmark.js
  32. +61 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/admin.js
  33. +109 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/blog.js
  34. +34 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/capped.js
  35. +76 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/cursor.js
  36. +156 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/gridfs.js
  37. +66 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/index_test.js
  38. +55 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/info.js
  39. +119 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/oplog.js
  40. +132 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/queries.js
  41. +144 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/replSetServersQueries.js
  42. +76 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/replSetServersSimple.js
  43. +49 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/simple.js
  44. +43 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/strict.js
  45. +50 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/types.js
  46. +17 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/url.js
  47. +3 −0  node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/.gitignore
  48. +19 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/Makefile
  49. +311 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/binary.cc
  50. +57 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/binary.h
  51. +1,629 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/bson.cc
  52. +57 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/bson.h
  53. +179 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/code.cc
  54. +44 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/code.h
  55. +199 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/dbref.cc
  56. +49 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/dbref.h
  57. +14 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/local.cc
  58. +14 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/local.h
  59. +596 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/long.cc
  60. +76 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/long.h
  61. +301 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/objectid.cc
  62. +54 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/objectid.h
  63. +218 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/test_bson.js
  64. +208 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/test_full_bson.js
  65. +592 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/timestamp.cc
  66. +79 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/timestamp.h
  67. +38 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/external-libs/bson/wscript
  68. +1 −0  node_modules/.npm/.cache/mongodb/0.9.4-3/package/index.js
  69. +13 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/install.sh
  70. +5,034 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/integration_tests.js
  71. +39 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/replicaTest.js
  72. +59 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/replicaset/connect_test.js
  73. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/test_gs_weird_bug.png
  74. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/test_gs_working_field_read.pdf
  75. +368 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/integration/tools/replica_set_manager.js
  76. +113 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/admin.js
  77. +265 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/bson/binary_parser.js
  78. +664 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/bson/bson.js
  79. +643 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/collection.js
  80. +35 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/base_command.js
  81. +148 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/db_command.js
  82. +34 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/delete_command.js
  83. +26 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/get_more_command.js
  84. +43 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/insert_command.js
  85. +37 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/kill_cursor_command.js
  86. +54 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/query_command.js
  87. +51 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/commands/update_command.js
  88. +274 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/connection.js
  89. +50 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/connections/repl_set_servers.js
  90. +96 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/connections/server.js
  91. +122 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/connections/server_cluster.js
  92. +110 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/connections/server_pair.js
  93. +345 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/crypto/md5.js
  94. +659 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/cursor.js
  95. +753 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/db.js
  96. +747 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/goog/math/integer.js
  97. +791 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/goog/math/long.js
  98. +194 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/gridfs/chunk.js
  99. +1,146 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/gridfs/gridstore.js
  100. +27 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/index.js
  101. +57 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/lib/mongodb/responses/mongo_reply.js
  102. +26 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/package.json
  103. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/bg.png
  104. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/hr.png
  105. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/loading.gif
  106. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/sprites.bg.png
  107. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/sprites.png
  108. BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/images/vr.png
  109. +149 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.css
  110. +115 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.growl.js
  111. +71 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.jquery.js
  112. +1,765 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.js
  113. +39 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.shell.js
  114. +90 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.timers.js
  115. +193 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/lib/jspec.xhr.js
  116. +258 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/spec.bson.js
  117. +100 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/spec.commands.js
  118. +29 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/spec.node.js
  119. +15 −0 node_modules/.npm/.cache/mongodb/0.9.4-3/package/spec/spec.objectid.js
  120. +1 −0  node_modules/.npm/connect-mongo/0.1.1/dependson/connect@1.4.1
  121. +1 −0  node_modules/.npm/connect-mongo/0.1.1/dependson/mongodb@0.9.4-3
  122. +1 −0  node_modules/.npm/connect-mongo/0.1.1/node_modules/connect
  123. +1 −0  node_modules/.npm/connect-mongo/0.1.1/node_modules/mongodb
  124. +3 −0  node_modules/.npm/connect-mongo/0.1.1/package/.npmignore
  125. +10 −0 node_modules/.npm/connect-mongo/0.1.1/package/History.md
  126. +5 −0 node_modules/.npm/connect-mongo/0.1.1/package/Makefile
  127. +67 −0 node_modules/.npm/connect-mongo/0.1.1/package/Readme.md
  128. +2 −0  node_modules/.npm/connect-mongo/0.1.1/package/index.js
  129. +145 −0 node_modules/.npm/connect-mongo/0.1.1/package/lib/connect-mongo.js
  130. +13 −0 node_modules/.npm/connect-mongo/0.1.1/package/package.json
  131. +1 −0  node_modules/.npm/connect-mongo/active
  132. +1 −0  node_modules/.npm/connect-mongodb/0.3.0/dependson/connect@1.4.1
  133. +1 −0  node_modules/.npm/connect-mongodb/0.3.0/dependson/mongodb@0.9.4-3
  134. +1 −0  node_modules/.npm/connect-mongodb/0.3.0/node_modules/connect
  135. +1 −0  node_modules/.npm/connect-mongodb/0.3.0/node_modules/mongodb
  136. +57 −0 node_modules/.npm/connect-mongodb/0.3.0/package/Readme.md
  137. +64 −0 node_modules/.npm/connect-mongodb/0.3.0/package/examples/index.js
  138. +1 −0  node_modules/.npm/connect-mongodb/0.3.0/package/index.js
  139. +210 −0 node_modules/.npm/connect-mongodb/0.3.0/package/lib/connect-mongodb.js
  140. +10 −0 node_modules/.npm/connect-mongodb/0.3.0/package/package.json
  141. +47 −0 node_modules/.npm/connect-mongodb/0.3.0/package/test/index.js
  142. +1 −0  node_modules/.npm/connect-mongodb/active
  143. +1 −0  node_modules/.npm/connect/1.4.1/dependents/connect-mongo@0.1.1
  144. +1 −0  node_modules/.npm/connect/1.4.1/dependents/connect-mongodb@0.3.0
  145. +1 −0  node_modules/.npm/mongodb/0.9.4-3/dependents/connect-mongo@0.1.1
  146. +1 −0  node_modules/.npm/mongodb/0.9.4-3/dependents/connect-mongodb@0.3.0
  147. +6 −0 node_modules/.npm/mongodb/0.9.4-3/package/.gitignore
  148. +7 −0 node_modules/.npm/mongodb/0.9.4-3/package/HISTORY
  149. +26 −0 node_modules/.npm/mongodb/0.9.4-3/package/Makefile
  150. +377 −0 node_modules/.npm/mongodb/0.9.4-3/package/Readme.md
  151. +34 −0 node_modules/.npm/mongodb/0.9.4-3/package/benchmark/grid_fs_write_benchmark.js
  152. +47 −0 node_modules/.npm/mongodb/0.9.4-3/package/benchmark/streaming_benchmark.js
  153. +61 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/admin.js
  154. +109 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/blog.js
  155. +34 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/capped.js
  156. +76 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/cursor.js
  157. +156 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/gridfs.js
  158. +66 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/index_test.js
  159. +55 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/info.js
  160. +119 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/oplog.js
  161. +132 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/queries.js
  162. +144 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/replSetServersQueries.js
  163. +76 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/replSetServersSimple.js
  164. +49 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/simple.js
  165. +43 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/strict.js
  166. +50 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/types.js
  167. +17 −0 node_modules/.npm/mongodb/0.9.4-3/package/examples/url.js
  168. +3 −0  node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/.gitignore
  169. +19 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/Makefile
  170. +311 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/binary.cc
  171. +57 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/binary.h
  172. +1,629 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/bson.cc
  173. +57 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/bson.h
  174. +179 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/code.cc
  175. +44 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/code.h
  176. +199 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/dbref.cc
  177. +49 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/dbref.h
  178. +14 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/local.cc
  179. +14 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/local.h
  180. +596 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/long.cc
  181. +76 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/long.h
  182. +301 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/objectid.cc
  183. +54 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/objectid.h
  184. +218 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/test_bson.js
  185. +208 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/test_full_bson.js
  186. +592 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/timestamp.cc
  187. +79 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/timestamp.h
  188. +38 −0 node_modules/.npm/mongodb/0.9.4-3/package/external-libs/bson/wscript
  189. +1 −0  node_modules/.npm/mongodb/0.9.4-3/package/index.js
  190. +13 −0 node_modules/.npm/mongodb/0.9.4-3/package/install.sh
  191. +5,034 −0 node_modules/.npm/mongodb/0.9.4-3/package/integration/integration_tests.js
  192. +39 −0 node_modules/.npm/mongodb/0.9.4-3/package/integration/replicaTest.js
  193. +59 −0 node_modules/.npm/mongodb/0.9.4-3/package/integration/replicaset/connect_test.js
  194. BIN  node_modules/.npm/mongodb/0.9.4-3/package/integration/test_gs_weird_bug.png
  195. BIN  node_modules/.npm/mongodb/0.9.4-3/package/integration/test_gs_working_field_read.pdf
  196. +368 −0 node_modules/.npm/mongodb/0.9.4-3/package/integration/tools/replica_set_manager.js
  197. +113 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/admin.js
  198. +265 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/bson/binary_parser.js
  199. +664 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/bson/bson.js
  200. +643 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/collection.js
  201. +35 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/base_command.js
  202. +148 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/db_command.js
  203. +34 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/delete_command.js
  204. +26 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/get_more_command.js
  205. +43 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/insert_command.js
  206. +37 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/kill_cursor_command.js
  207. +54 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/query_command.js
  208. +51 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/commands/update_command.js
  209. +274 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/connection.js
  210. +50 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/connections/repl_set_servers.js
  211. +96 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/connections/server.js
  212. +122 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/connections/server_cluster.js
  213. +110 −0 node_modules/.npm/mongodb/0.9.4-3/package/lib/mongodb/connections/server_pair.js
Sorry, we could not display the entire diff because it was too big.
View
1  node_modules/.npm/.cache/connect-mongo/.cache.json
@@ -0,0 +1 @@
+{"_id":"connect-mongo","_rev":"5-90d5985db3da81630c11222e2827a189","name":"connect-mongo","description":"MongoDB session store for Connect","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"connect-mongo","version":"0.1.0","description":"MongoDB session store for Connect","keywords":["connect","mongo","mongodb","session","express"],"author":{"name":"Casey Banner","email":"kcbanner@gmail.com"},"dependencies":{"connect":">=1.0.3","mongodb":">=0.8.0"},"main":"index","engines":{"node":"0.4.x"},"_id":"connect-mongo@0.1.0","_engineSupported":true,"_npmVersion":"0.3.14","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"01624c23c53dd87bf5ffc77917ea9adad845fcda","tarball":"http://registry.npmjs.org/connect-mongo/-/connect-mongo-0.1.0.tgz"}},"0.1.1":{"name":"connect-mongo","version":"0.1.1","description":"MongoDB session store for Connect","keywords":["connect","mongo","mongodb","session","express"],"author":{"name":"Casey Banner","email":"kcbanner@gmail.com"},"dependencies":{"connect":">=1.0.3","mongodb":">=0.8.0"},"main":"index","engines":{"node":"0.4.x"},"_id":"connect-mongo@0.1.1","_engineSupported":true,"_npmVersion":"0.3.14","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"66df471064d0fcecbc8ac8260ac946e5be29d8e6","tarball":"http://registry.npmjs.org/connect-mongo/-/connect-mongo-0.1.1.tgz"}}},"maintainers":[{"name":"kcbanner","email":"kcbanner@gmail.com"}],"time":{"0.1.0":"2011-03-08T05:36:36.605Z","0.1.1":"2011-03-18T01:01:09.965Z"},"author":{"name":"Casey Banner","email":"kcbanner@gmail.com"},"_etag":"\"CQYUV9K7RODQDGJB95NEDOMVK\""}
View
1  node_modules/.npm/.cache/connect-mongo/0.1.1/.cache.json
@@ -0,0 +1 @@
+{"name":"connect-mongo","version":"0.1.1","description":"MongoDB session store for Connect","keywords":["connect","mongo","mongodb","session","express"],"author":{"name":"Casey Banner","email":"kcbanner@gmail.com"},"dependencies":{"connect":">=1.0.3","mongodb":">=0.8.0"},"main":"index","engines":{"node":"0.4.x"},"_id":"connect-mongo@0.1.1","_engineSupported":true,"_npmVersion":"0.3.14","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"66df471064d0fcecbc8ac8260ac946e5be29d8e6","tarball":"http://registry.npmjs.org/connect-mongo/-/connect-mongo-0.1.1.tgz"},"_etag":"\"CQYUV9K7RODQDGJB95NEDOMVK\""}
View
39 node_modules/.npm/.cache/connect-mongo/0.1.1/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "connect-mongo",
+ "version": "0.1.1",
+ "description": "MongoDB session store for Connect",
+ "keywords": [
+ "connect",
+ "mongo",
+ "mongodb",
+ "session",
+ "express"
+ ],
+ "author": {
+ "name": "Casey Banner",
+ "email": "kcbanner@gmail.com"
+ },
+ "dependencies": {
+ "connect": ">=1.0.3",
+ "mongodb": ">=0.8.0"
+ },
+ "main": "index",
+ "engines": {
+ "node": "0.4.x"
+ },
+ "_id": "connect-mongo@0.1.1",
+ "_engineSupported": true,
+ "_npmVersion": "0.3.18",
+ "_nodeVersion": "v0.5.0-pre",
+ "directories": {
+ "lib": "./lib"
+ },
+ "files": [
+ ""
+ ],
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "a14e34f80e087eefdbceacbc9d74abb318f78fc0",
+ "tarball": "http://registry.npmjs.org/connect-mongo/-/connect-mongo-0.1.1.tgz"
+ }
+}
View
BIN  node_modules/.npm/.cache/connect-mongo/0.1.1/package.tgz
Binary file not shown
View
3  node_modules/.npm/.cache/connect-mongo/0.1.1/package/.npmignore
@@ -0,0 +1,3 @@
+support
+test
+examples
View
10 node_modules/.npm/.cache/connect-mongo/0.1.1/package/History.md
@@ -0,0 +1,10 @@
+0.1.1 / 2010-03-18
+==================
+
+ * Fixed authentication
+
+
+0.1.0 / 2010-03-08
+==================
+
+ * Initial release
View
5 node_modules/.npm/.cache/connect-mongo/0.1.1/package/Makefile
@@ -0,0 +1,5 @@
+
+test:
+ @expresso --serial -I lib
+
+.PHONY: test
View
67 node_modules/.npm/.cache/connect-mongo/0.1.1/package/Readme.md
@@ -0,0 +1,67 @@
+
+# connect-mongo
+
+ MongoDB session store for Connect
+
+ connect-mongo supports only connect `>= 1.0.3`.
+
+## Installation
+
+via npm:
+
+ $ npm install connect-mongo
+
+## Options
+
+ - `db` Database
+ - `collection` Collection (optional, default: `sessions`)
+ - `host` MongoDB server hostname (optional, default: `127.0.0.1`)
+ - `port` MongoDB server port (optional, default: `27017`)
+ - `username` Username (optional)
+ - `password` Password (optional)
+
+## Example
+
+With express:
+
+ var MongoStore = require('connect-mongo');
+
+ app.use(express.session({
+ secret: settings.cookie_secret,
+ store: new MongoStore({
+ db: settings.db
+ })
+ }));
+
+## Tests
+
+You need should and expresso.
+
+ make test
+
+The tests use a database called `connect-mongo-test`.
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 Casey Banner <kcbanner@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2  node_modules/.npm/.cache/connect-mongo/0.1.1/package/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/connect-mongo');
View
145 node_modules/.npm/.cache/connect-mongo/0.1.1/package/lib/connect-mongo.js
@@ -0,0 +1,145 @@
+
+/*!
+ * connect-mongo
+ * Copyright(c) 2011 Casey Banner <kcbanner@gmail.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies
+ */
+
+var Store = require('connect').session.Store;
+var mongo = require('mongodb');
+
+/**
+ * Default options
+ */
+
+var defaultOptions = {host: '127.0.0.1', port: 27017, collection: 'sessions'};
+
+/**
+ * Initialize MongoStore with the given `options`.
+ * Calls `callback` when db connection is ready (mainly for testing purposes).
+ *
+ * @param {Object} options
+ * @param {Function} callback
+ * @api public
+ */
+
+var MongoStore = module.exports = function MongoStore(options, callback) {
+ options = options || {};
+ Store.call(this, options);
+
+ if(!options.db) {
+ throw new Error('Required MongoStore option `db` missing');
+ }
+
+ var self = this;
+ var getCollection = function(callback) {
+ self.db.collection(options.collection || defaultOptions.collection, function(err, collection) {
+ if (err) {
+ throw new Error('Error getting collection: ' + options.collection || defaultOptions.collection);
+ }
+
+ self.collection = collection;
+ callback && callback();
+ });
+ };
+
+ this.db = new mongo.Db(options.db || defaultOptions.db, new mongo.Server(options.host || defaultOptions.host,
+ options.port || defaultOptions.port, {}));
+ this.db.open(function(err, db) {
+ if (err) {
+ throw new Error('Error connecting to db');
+ }
+
+ if (options.username && options.password) {
+ db.authenticate(options.username, options.password, function () {
+ getCollection(callback);
+ });
+ } else {
+ getCollection(callback);
+ }
+ });
+};
+
+/**
+ * Inherit from `Store`.
+ */
+
+MongoStore.prototype.__proto__ = Store.prototype;
+
+/**
+ * Attempt to fetch session by the given `sid`.
+ *
+ * @param {String} sid
+ * @param {Function} fn
+ * @api public
+ */
+MongoStore.prototype.get = function(sid, callback) {
+ this.collection.findOne({_id: sid}, function(err, session) {
+ try {
+ if (session) {
+ callback(err, JSON.parse(session.session));
+ } else {
+ return callback();
+ }
+ } catch (err) {
+ callback(err);
+ }
+ });
+};
+
+/**
+ * Commit the given `sess` object associated with the given `sid`.
+ *
+ * @param {String} sid
+ * @param {Session} sess
+ * @param {Function} fn
+ * @api public
+ */
+
+MongoStore.prototype.set = function(sid, session, callback) {
+ try {
+ var s = {_id: sid, session: JSON.stringify(session)};
+ this.collection.update({_id: sid}, s, {upsert: true}, function(err, data) {
+ callback && callback(err, JSON.parse(data.session));
+ });
+ } catch (err) {
+ callback && callback(err);
+ }
+};
+
+/**
+ * Destroy the session associated with the given `sid`.
+ *
+ * @param {String} sid
+ * @api public
+ */
+
+MongoStore.prototype.destroy = function(sid, callback) {
+ this.collection.remove({_id: sid}, callback);
+};
+
+/**
+ * Fetch number of sessions.
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+MongoStore.prototype.length = function(callback) {
+ this.collection.count({}, callback);
+};
+
+/**
+ * Clear all sessions.
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+MongoStore.prototype.clear = function(callback) {
+ this.collection.drop(callback);
+};
View
13 node_modules/.npm/.cache/connect-mongo/0.1.1/package/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "connect-mongo",
+ "version": "0.1.1",
+ "description": "MongoDB session store for Connect",
+ "keywords": ["connect", "mongo", "mongodb", "session", "express"],
+ "author": "Casey Banner <kcbanner@gmail.com>",
+ "dependencies": {
+ "connect": ">=1.0.3",
+ "mongodb": ">=0.8.0"
+ },
+ "main": "index",
+ "engines": { "node": "0.4.x" }
+}
View
1  node_modules/.npm/.cache/connect-mongodb/.cache.json
@@ -0,0 +1 @@
+{"_id":"connect-mongodb","_rev":"20-0ea984a21005a5d0e239539964331413","name":"connect-mongodb","description":"mongoDB session store for Connect","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.2":{"name":"connect-mongodb","description":"MongoDB session store for Connect","version":"0.0.2","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"dependencies":{"mongodb":">=0.7.9"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.1.98"},"_id":"connect-mongodb@0.0.2","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.0.2.tgz"},"directories":{}},"0.0.4":{"name":"connect-mongodb","description":"MongoDB session store for Connect","version":"0.0.4","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.7.9"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.1.98"},"_id":"connect-mongodb@0.0.4","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.0.4.tgz"},"directories":{}},"0.1.0":{"name":"connect-mongodb","description":"MongoDB session store for Connect","version":"0.1.0","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.7.9"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.1.98"},"_id":"connect-mongodb@0.1.0","_engineSupported":true,"_npmVersion":"0.2.13-3","_nodeVersion":"v0.2.3","dist":{"shasum":"7be22249204320066c8b50b18a1a99b9fa9fc9b1","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.1.0.tgz"},"directories":{}},"0.1.1":{"name":"connect-mongodb","description":"MongoDB session store for Connect","version":"0.1.1","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.7.9"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.1.98"},"_id":"connect-mongodb@0.1.1","_engineSupported":true,"_npmVersion":"0.2.14-3","_nodeVersion":"v0.2.6","directories":{"lib":"./lib"},"modules":{"connect-mongodb.js":"lib/connect-mongodb.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"cb9dfb2cb5c783ed050f603dfdbc77388f91484c","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.1.1.tgz"}},"0.2.0":{"name":"connect-mongodb","description":"mongoDB session store for Connect","version":"0.2.0","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.8.0"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.4.0"},"_id":"connect-mongodb@0.2.0","_engineSupported":true,"_npmVersion":"0.2.19","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"1343e702fc090515b626b0d60c42b1bd6c702c8c","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.2.0.tgz"}},"0.2.1":{"name":"connect-mongodb","description":"mongoDB session store for Connect","version":"0.2.1","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.8.0"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.4.0"},"_id":"connect-mongodb@0.2.1","_engineSupported":true,"_npmVersion":"0.2.19","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"48dc02ba7667155ac75d8600cd4bf488a4985bea","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.2.1.tgz"}},"0.2.2":{"name":"connect-mongodb","description":"mongoDB session store for Connect","version":"0.2.2","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.8.0","connect":">=1.1.3"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.4.0"},"_id":"connect-mongodb@0.2.2","_engineSupported":true,"_npmVersion":"0.2.19","_nodeVersion":"v0.4.2","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"65d9e1198ae686a856155ee1386ab34d4c4e134e","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.2.2.tgz"}},"0.3.0":{"name":"connect-mongodb","description":"mongoDB session store for Connect","version":"0.3.0","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.8.0","connect":">=1.4.0"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.4.0"},"devDependencies":{},"_id":"connect-mongodb@0.3.0","_engineSupported":true,"_npmVersion":"1.0.1rc9","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"9f4264d51d868366c3a65ea8482e3b5e48c6372c","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.3.0.tgz"},"directories":{}}},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}],"author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"time":{"0.0.2":"2011-01-08T14:15:51.862Z","0.0.4":"2011-01-08T14:15:51.862Z","0.1.0":"2011-01-08T14:15:51.862Z","0.1.1":"2011-01-10T00:43:36.794Z","0.2.0":"2011-03-13T23:57:27.136Z","0.2.1":"2011-03-14T00:16:58.182Z","0.2.2":"2011-03-23T18:47:49.944Z","0.3.0":"2011-04-28T23:40:57.858Z"},"_etag":"\"BPYZDCT1BO6SG7YFB3WABQZJH\""}
View
1  node_modules/.npm/.cache/connect-mongodb/0.3.0/.cache.json
@@ -0,0 +1 @@
+{"name":"connect-mongodb","description":"mongoDB session store for Connect","version":"0.3.0","author":{"name":"Vladimir Dronnikov","email":"dronnikov@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"ramv"}],"dependencies":{"mongodb":">=0.8.0","connect":">=1.4.0"},"main":"./lib/connect-mongodb","engines":{"node":">= 0.4.0"},"devDependencies":{},"_id":"connect-mongodb@0.3.0","_engineSupported":true,"_npmVersion":"1.0.1rc9","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"9f4264d51d868366c3a65ea8482e3b5e48c6372c","tarball":"http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.3.0.tgz"},"directories":{},"_etag":"\"BPYZDCT1BO6SG7YFB3WABQZJH\""}
View
40 node_modules/.npm/.cache/connect-mongodb/0.3.0/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "connect-mongodb",
+ "description": "mongoDB session store for Connect",
+ "version": "0.3.0",
+ "author": {
+ "name": "Vladimir Dronnikov",
+ "email": "dronnikov@gmail.com"
+ },
+ "contributors": [
+ {
+ "name": "Pau Ramon",
+ "email": "masylum@gmail.com"
+ },
+ {
+ "name": "ramv"
+ }
+ ],
+ "dependencies": {
+ "mongodb": ">=0.8.0",
+ "connect": ">=1.4.0"
+ },
+ "main": "./lib/connect-mongodb",
+ "engines": {
+ "node": ">= 0.4.0"
+ },
+ "devDependencies": {},
+ "_id": "connect-mongodb@0.3.0",
+ "_engineSupported": true,
+ "_npmVersion": "0.3.18",
+ "_nodeVersion": "v0.5.0-pre",
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "77955700016ecca5c89096c667a9b181655e027b",
+ "tarball": "http://registry.npmjs.org/connect-mongodb/-/connect-mongodb-0.3.0.tgz"
+ },
+ "directories": {},
+ "files": [
+ ""
+ ]
+}
View
BIN  node_modules/.npm/.cache/connect-mongodb/0.3.0/package.tgz
Binary file not shown
View
57 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/Readme.md
@@ -0,0 +1,57 @@
+# connect-mongodb
+
+connect-mongodb is a mongoDB session store backed by [node-mongodb-native](http://github.com/christkv/node-mongodb-native).
+
+Originally written by [dvv](http://github.com/dvv)
+
+## Installation
+
+via npm:
+
+ $ npm install connect-mongodb
+
+## Options
+
+You can build your MongoDB connection url passing an object with the following parameters:
+
+ * `dbname` MongoDB db name _'dev' by default_
+ * `host` MongoDB server hostname _'127.0.0.1' by default_
+ * `port` MongoDB server port _27017 by default_
+ * `username` MongoDB server username
+ * `password` MongoDB server password
+
+Or just the url:
+
+ * `url` MongoDB connection url
+
+Other options:
+
+ * `collection` MongoDB collection to host sessions. _'sessions' by default_
+ * `reapInterval` ms to check expired sessions to remove on db
+
+## Example
+
+You have a complete example on `examples/index.js`.
+
+ var connect = require('connect'),
+ mongoStore = require('connect-mongodb');
+
+ connect.createServer(
+ connect.bodyParser(),
+ connect.cookieParser(),
+ connect.session({
+ cookie: {maxAge: 60000 * 20}, // 20 minutes
+ secret: 'foo',
+ store: new mongoStore({
+ dbname: 'production',
+ username: 'foo',
+ password: 'bar'
+ })
+ })
+ );
+
+## test
+
+To run the tests:
+
+ node test
View
64 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/examples/index.js
@@ -0,0 +1,64 @@
+var sys = require('sys'),
+ http = require('http'),
+ connect = require('connect'),
+ mongoStore = require('../lib/connect-mongodb'),
+ mongo_store = new mongoStore({reapInterval: 5000});
+
+http.IncomingMessage.prototype.flash = function (type, msg) {
+ var msgs = this.session.flash = this.session.flash || {};
+ if (type && msg) {
+ (msgs[type] = msgs[type] || []).push(msg);
+ } else if (type) {
+ var arr = msgs[type];
+ delete msgs[type];
+ return arr || [];
+ } else {
+ this.session.flash = {};
+ return msgs;
+ }
+};
+
+connect.createServer(
+
+ connect.bodyParser(),
+ connect.cookieParser(),
+ // reap every 5 seconds, 10 seconds maxAge
+ connect.session({cookie: {maxAge: 10000}, store: mongo_store, secret: 'foo'}),
+
+ // Ignore favicon
+ function (req, res, next) {
+ if (req.url === '/favicon.ico') {
+ res.writeHead(404, {});
+ res.end();
+ } else {
+ next();
+ }
+ },
+
+ // Increment views
+ function (req, res) {
+ req.session.count = req.session.count || 0
+ ++req.session.count;
+
+ // Display online count
+ req.sessionStore.length(function(err, len){
+ if (req.session.count < 10) {
+ var msgs = req.flash('info').join('\n');
+ res.writeHead(200, { 'Content-Type': 'text/html' });
+ res.write(msgs);
+ res.write('<form method="post"><input type="hidden" name="foo" value="bar" /><input type="submit" value="POST request!" /></form>');
+ res.write('<p>online : ' + len + '</p>');
+ res.end('<p>views: ' + req.session.count + '</p>');
+ } else {
+ // regenerate session after 10 views
+ req.session.regenerate(function(){
+ req.flash('info', 'sess key is now <strong>' + req.sessionID + '</strong>');
+ res.writeHead(200, { 'Content-Type': 'text/html' });
+ res.end('regenerated session');
+ });
+ }
+ });
+ }
+).listen(3000);
+
+sys.puts('Connect server started on port 3000');
View
1  node_modules/.npm/.cache/connect-mongodb/0.3.0/package/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/connect-mongodb');
View
210 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/lib/connect-mongodb.js
@@ -0,0 +1,210 @@
+/*!
+ * Connect - Mongodb
+ * Copyright(c) 2010 Vladimir Dronnikov <dronnikov@gmail.com>
+ * Mantained by Pau Ramon Revilla <masylum@gmail.com>
+ * MIT Licensed
+ */
+
+var Store = require('connect').session.Store,
+ mongo = require('mongodb'),
+
+ _collection = null,
+ _default = function (callback) {
+ callback = callback || function () { };
+ return callback;
+ },
+
+ defaults = {host: '127.0.0.1', port: 27017, dbname: '/dev', collection: 'sessions'},
+
+ getConnectionURL = function (options) {
+ var url = 'mongo://';
+
+ if (options.username) {
+ url += options.username;
+ if (options.password) {
+ url += ':' + options.password;
+ } else {
+ throw Error('Username set without password. Need both to make a connection');
+ }
+ url += '@';
+ }
+
+ url += options.host || defaults.host;
+ url += options.port ? ':' + options.port : ':' + defaults.port;
+ url += options.dbname ? '/' + options.dbname : defaults.dbname;
+
+ // delete this options so we don't send them to Server
+ ['username', 'password', 'host', 'port', 'dbname'].forEach(function (attr) {
+ delete options[attr];
+ });
+
+ if (options.url) {
+ return options.url;
+ } else {
+ return url;
+ }
+ },
+
+ parseConnectionURL = function (url) {
+ var config = require('url').parse(url),
+ auth = null;
+
+ if (!config.protocol.match(/^mongo/)) {
+ throw new Error("URL must be in the format mongo://user:pass@host:port/dbname");
+ }
+
+ if (config.auth) {
+ auth = config.auth.split(':', 2);
+ }
+
+ return {
+ host: config.hostname || defaults.host,
+ port: config.port || defaults.port,
+ dbname: config.pathname.replace(/^\//, '') || defaults.dbname,
+ username: auth && auth[0],
+ password: auth && auth[1]
+ };
+ };
+
+
+/**
+ * Initialize MongoStore with the given `options`.
+ *
+ * @param {Object} options
+ * @api public
+ */
+
+var MONGOSTORE = module.exports = function MongoStore(options) {
+
+ options = options || {};
+
+ var _url = getConnectionURL(options),
+ _details = parseConnectionURL(_url), // mongodb 0.7.9 parser is broken, this fixes it
+ _db = new mongo.Db(_details.dbname, new mongo.Server(_details.host, _details.port, options)),
+
+ _getCollection = function (_db) {
+ _db.collection(options.collection || defaults.collection, function (err, col) {
+ if (err) {
+ throw err;
+ }
+ _collection = col;
+ });
+ };
+
+ Store.call(this, options);
+
+ if (options.reapInterval !== -1) {
+ setInterval(function () {
+ _collection.remove({expires: {'$lte': Date.now()}}, function () { });
+ }, options.reapInterval || 60 * 1000, this); // every minute
+ }
+
+
+ _db.open(function (err) {
+ if (err) {
+ throw Error("Error connecting to " + _url);
+ }
+
+ if (_details.username && _details.password) {
+ _db.authenticate(_details.username, _details.password, function () {
+ _getCollection(_db);
+ });
+ } else {
+ _getCollection(_db);
+ }
+ });
+};
+
+MONGOSTORE.prototype.__proto__ = Store.prototype;
+
+/**
+ * Attempt to fetch session by the given `sid`.
+ *
+ * @param {String} sid
+ * @param {Function} cb
+ * @api public
+ */
+
+MONGOSTORE.prototype.get = function (sid, cb) {
+ _default(cb);
+ _collection.findOne({_id: sid}, function (err, data) {
+ try {
+ if (data) {
+ cb(null, JSON.parse(data.session.toString()));
+ } else {
+ cb();
+ }
+ } catch (exc) {
+ cb(exc);
+ }
+ });
+};
+
+
+/**
+ * Commit the given `sess` object associated with the given `sid`.
+ *
+ * @param {String} sid
+ * @param {Session} sess
+ * @param {Function} cb
+ * @api public
+ */
+
+MONGOSTORE.prototype.set = function (sid, sess, cb) {
+ _default(cb);
+ try {
+ var update = {_id: sid, session: JSON.stringify(sess)};
+ if (sess && sess.cookie && sess.cookie.expires) {
+ update.expires = Date.parse(sess.cookie.expires);
+ }
+
+ _collection.update({_id: sid}, update, {upsert: true}, function (err, data) {
+ cb.apply(this, arguments);
+ });
+ } catch (exc) {
+ cb(exc);
+ }
+};
+
+/**
+ * Destroy the session associated with the given `sid`.
+ *
+ * @param {String} sid
+ * @api public
+ */
+
+MONGOSTORE.prototype.destroy = function (sid, cb) {
+ _collection.remove({_id: sid}, _default(cb));
+};
+
+/**
+ * Fetch number of sessions.
+ *
+ * @param {Function} cb
+ * @api public
+ */
+
+MONGOSTORE.prototype.length = function (cb) {
+ _collection.count({}, _default(cb));
+};
+
+/**
+ * Clear all sessions.
+ *
+ * @param {Function} cb
+ * @api public
+ */
+
+MONGOSTORE.prototype.clear = function (cb) {
+ _collection.drop(_default(cb));
+};
+
+/**
+ * Get the collection
+ *
+ * @param
+ * @api public
+ */
+MONGOSTORE.prototype.getCollection = function () {
+ return _collection;
+};
View
10 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "connect-mongodb",
+ "description": "mongoDB session store for Connect",
+ "version": "0.3.0",
+ "author": "Vladimir Dronnikov <dronnikov@gmail.com>",
+ "contributors": ["Pau Ramon <masylum@gmail.com>", "ramv"],
+ "dependencies": { "mongodb": ">=0.8.0", "connect": ">=1.4.0"},
+ "main": "./lib/connect-mongodb",
+ "engines": { "node": ">= 0.4.0" }
+}
View
47 node_modules/.npm/.cache/connect-mongodb/0.3.0/package/test/index.js
@@ -0,0 +1,47 @@
+var assert = require('assert'),
+ sys = require('sys'),
+ mongoStore = require('../index');
+
+var store = mongoStore({ maxAge: 15000 }, function (client) {
+
+ // #set()
+ store.set('123', { name: 'tj' }, function (err, ok) {
+ assert.ok(!err, '#set() got an error');
+ assert.ok(ok, '#set() is not ok');
+
+ // #get()
+ store.get('123', function (err, data) {
+ assert.ok(!err, '#get() got an error');
+ assert.deepEqual({ name: 'tj' }, data);
+
+ // #length()
+ store.length(function (err, len) {
+ assert.ok(!err, '#length() got an error');
+ assert.equal(1, len, '#length() with keys');
+
+ // #clear()
+ store.clear(function (err, ok) {
+ assert.ok(!err, '#clear()');
+ assert.ok(ok, '#clear()');
+
+ // #length()
+ store.length(function (err, len) {
+ assert.ok(!err, '#length()');
+ assert.equal(0, len, '#length() without keys');
+
+ // #set null
+ store.set('123', { name: 'tj' }, function () {
+ store.destroy('123', function () {
+ store.length(function (err, len) {
+ assert.equal(0, len, '#set() null');
+ console.log('done');
+ process.exit(1);
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+});
View
1  node_modules/.npm/.cache/mongodb/.cache.json
@@ -0,0 +1 @@
+{"_id":"mongodb","_rev":"48-1d7e5b3686149d1df957229f0b32e921","name":"mongodb","description":"A node.js driver for MongoDB","dist-tags":{"latest":"0.9.4-3","stable":"0.9.4-3"},"versions":{"0.7.9":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.7.9","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"http://github.com/christkv/node-mongodb-native.git"},"bugs":{"mail":"node-mongodb-native@googlegroups.com","web":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.1.97"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.7.9","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.7.9.tgz"}},"0.9.0":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.0","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"make total"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.9.0","_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.4.1","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"6eb818a11b4dcbe48976184aec26e908c1a69fc7","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.0.tgz"}},"0.9.1":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.1","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.9.1","_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.4.1","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"0b4c97289d9c88fc726a9993a8632d2ebe3284d6","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.1.tgz"}},"0.9.2":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.2","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.9.2","_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.4.2","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"a6563e371dc8019ac32e1ea8ed2ef4334c230c1d","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.2.tgz","bin":{"0.4-sunos-5.11":{"shasum":"ea4afdca4f1713bfbed344857b4ddce4d3039ce4","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.2-0.4-sunos-5.11.tgz"}}}},"0.9.3":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.3","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"bash ./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.9.3","_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.4.6","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"3249cd9aff86b37451cffdba73d26bdefbad06c3","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.3.tgz","bin":{"0.4-sunos-5.11":{"shasum":"299d0cf9fc1df1f70c095d8eb83b60db6c9d4ca9","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.3-0.4-sunos-5.11.tgz"}}}},"0.9.4":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.4","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"bash ./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"mongodb@0.9.4","_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.4.6","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"05f710f3c9e0186ee63ed30f70e21d18fb069a76","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.4.tgz"}},"0.9.4-3":{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.4-3","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"bash ./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{},"devDependencies":{},"_id":"mongodb@0.9.4-3","_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"56236dcd8f5d57d497ef40172e9a745067f5149d","bin":{"0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0":{"shasum":"2a0759438c343d210d8775e7005be4e56a6e6ec0","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3-0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0.tgz"}},"tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3.tgz"}}},"maintainers":[{"name":"christkv","email":"christkv@gmail.com"}],"author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"time":{"0.7.9":"2011-02-27T12:47:33.729Z","0.9.0":"2011-02-27T12:47:33.729Z","0.9.1":"2011-03-01T18:16:37.495Z","0.9.2":"2011-03-23T12:42:58.369Z","0.9.3":"2011-04-15T14:26:50.897Z","0.9.4":"2011-04-29T19:10:30.115Z","0.9.4-3":"2011-05-10T12:39:06.478Z"},"_etag":"\"8VZQCTUO9ERT14LJ36G1AO80O\""}
View
1  node_modules/.npm/.cache/mongodb/0.9.4-3/.cache.json
@@ -0,0 +1 @@
+{"name":"mongodb","description":"A node.js driver for MongoDB","version":"0.9.4-3","author":{"name":"Christian Amor Kvalheim","email":"christkv@gmail.com"},"contributors":[{"name":"Nathan White","email":"nw@nwhite.net"},{"name":"Adam Wiggins","email":"adam@heroku.com"},{"name":"Ian Millington","email":"idmillington@googlemail.com"},{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"Ciaran Jessup","email":"ciaranj@gmail.com"},{"name":"Christoph Pojer"},{"name":"Erik Abele"},{"name":"Henrik Johansson","email":"dahankzter@gmail.com"}],"repository":{"type":"git","url":"git://github.com/christkv/node-mongodb-native.git"},"bugs":{"email":"node-mongodb-native@googlegroups.com","url":"http://github.com/christkv/node-mongodb-native/issues"},"os":["linux","darwin","freebsd"],"main":"./lib/mongodb/index","directories":{"lib":"./lib/mongodb"},"engines":{"node":">=0.4.0"},"scripts":{"install":"bash ./install.sh"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{},"devDependencies":{},"_id":"mongodb@0.9.4-3","_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"56236dcd8f5d57d497ef40172e9a745067f5149d","bin":{"0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0":{"shasum":"2a0759438c343d210d8775e7005be4e56a6e6ec0","tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3-0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0.tgz"}},"tarball":"http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3.tgz"},"_etag":"\"8VZQCTUO9ERT14LJ36G1AO80O\""}
View
90 node_modules/.npm/.cache/mongodb/0.9.4-3/package.json
@@ -0,0 +1,90 @@
+{
+ "name": "mongodb",
+ "description": "A node.js driver for MongoDB",
+ "version": "0.9.4-3",
+ "author": {
+ "name": "Christian Amor Kvalheim",
+ "email": "christkv@gmail.com"
+ },
+ "contributors": [
+ {
+ "name": "Nathan White",
+ "email": "nw@nwhite.net"
+ },
+ {
+ "name": "Adam Wiggins",
+ "email": "adam@heroku.com"
+ },
+ {
+ "name": "Ian Millington",
+ "email": "idmillington@googlemail.com"
+ },
+ {
+ "name": "Aaron Heckmann",
+ "email": "aaron.heckmann+github@gmail.com"
+ },
+ {
+ "name": "Ciaran Jessup",
+ "email": "ciaranj@gmail.com"
+ },
+ {
+ "name": "Christoph Pojer"
+ },
+ {
+ "name": "Erik Abele"
+ },
+ {
+ "name": "Henrik Johansson",
+ "email": "dahankzter@gmail.com"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/christkv/node-mongodb-native.git"
+ },
+ "bugs": {
+ "email": "node-mongodb-native@googlegroups.com",
+ "url": "http://github.com/christkv/node-mongodb-native/issues"
+ },
+ "os": [
+ "linux",
+ "darwin",
+ "freebsd"
+ ],
+ "main": "./lib/mongodb/index",
+ "directories": {
+ "lib": "./lib/mongodb"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "scripts": {
+ "install": "bash ./install.sh"
+ },
+ "licenses": [
+ {
+ "type": "Apache License, Version 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0"
+ }
+ ],
+ "dependencies": {},
+ "devDependencies": {},
+ "_id": "mongodb@0.9.4-3",
+ "_engineSupported": true,
+ "_npmVersion": "0.3.18",
+ "_nodeVersion": "v0.5.0-pre",
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "8fcaaacafa45ab5ac3a8c0e30ad45693309b329d",
+ "bin": {
+ "0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0": {
+ "shasum": "2a0759438c343d210d8775e7005be4e56a6e6ec0",
+ "tarball": "http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3-0.4-ares1.7.4-ev4.4-openssl0.9.8l-v83.1.8.10-darwin-10.7.0.tgz"
+ }
+ },
+ "tarball": "http://registry.npmjs.org/mongodb/-/mongodb-0.9.4-3.tgz"
+ },
+ "files": [
+ ""
+ ]
+}
View
BIN  node_modules/.npm/.cache/mongodb/0.9.4-3/package.tgz
Binary file not shown
View
6 node_modules/.npm/.cache/mongodb/0.9.4-3/package/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.swp
+*.seed
+.project
+.settings
+data
View
7 node_modules/.npm/.cache/mongodb/0.9.4-3/package/HISTORY
@@ -0,0 +1,7 @@
+0.6.8
+* Removed multiple message concept from bson
+* Changed db.open(db) to be db.open(err, db)
+0.1 2010-01-30
+* Initial release support of driver using native node.js interface
+* Supports gridfs specificatio
+* Supports admin functionality
View
26 node_modules/.npm/.cache/mongodb/0.9.4-3/package/Makefile
@@ -0,0 +1,26 @@
+
+NODE = node
+name = all
+
+total: build_native
+
+build_native:
+ $(MAKE) -C ./external-libs/bson
+
+clean_native:
+ $(MAKE) -C ./external-libs/bson clean
+
+test: build_native test_integration_pure test_integration_native
+ @$(NODE) spec/spec.node.js
+
+test_integration_pure:
+ @$(NODE) integration/integration_tests.js pure $(name)
+
+test_integration_native:
+ @$(NODE) integration/integration_tests.js native $(name)
+
+clean:
+ rm ./external-libs/bson/bson.node
+ rm -r ./external-libs/bson/build
+
+.PHONY: total
View
377 node_modules/.npm/.cache/mongodb/0.9.4-3/package/Readme.md
@@ -0,0 +1,377 @@
+Install
+========
+
+Run:
+
+ make
+
+Community
+========
+Check out the google group http://groups.google.com/group/node-mongodb-native for questions/answers from users of the driver.
+
+Introduction
+========
+
+This is a node.js driver for MongoDB. It's a port (or close to a port) of the libary for ruby at http://github.com/mongodb/mongo-ruby-driver/.
+
+A simple example of inserting a document.
+
+ var client = new Db('test', new Server("127.0.0.1", 27017, {})),
+ test = function (err, collection) {
+ collection.insert({a:2}, function(err, docs) {
+
+ collection.count(function(err, count) {
+ test.assertEquals(1, count);
+ });
+
+ // Locate all the entries using find
+ collection.find().toArray(function(err, results) {
+ test.assertEquals(1, results.length);
+ test.assertTrue(results.a === 2);
+
+ // Let's close the db
+ client.close();
+ });
+ });
+ };
+
+ client.open(function(err, p_client) {
+ client.collection('test_insert', test);
+ });
+
+Important
+========
+
+To enable the driver to use the C/C++ bson parser pass it the option native_parser:true like below
+
+ var client = new Db('integration_tests_20',
+ new Server("127.0.0.1", 27017),
+ {native_parser:true});
+
+The version V0.8.0 > contains a C/C++ native BSON parser, this leads to some small changes in the way you need to access the BSON classes as you need to use the right versions of the classes with the right driver.
+
+To access the correct version of BSON objects for your instance do the following
+
+ client.bson_serializer.Long
+ client.bson_serializer.ObjectID
+ client.bson_serializer.Timestamp
+ client.bson_serializer.DBRef
+ client.bson_serializer.Binary
+ client.bson_serializer.Code
+
+GitHub information
+--------
+
+The source code is available at http://github.com/christkv/node-mongodb-native.
+You can either clone the repository or download a tarball of the latest release.
+
+Once you have the source you can test the driver by running
+
+ $ make test
+
+in the main directory. You will need to have a mongo instance running on localhost for the integration tests to pass.
+
+Examples
+========
+
+For examples look in the examples/ directory. You can execute the examples using node.
+
+ $ cd examples
+ $ node queries.js
+
+GridStore
+========
+
+The GridStore class allows for storage of binary files in mongoDB using the mongoDB defined files and chunks collection definition.
+
+See the gridfs.js file under examples/ for how to use it or view the integration tests marked with test_gs_...
+
+Notes
+========
+
+The current version does not support connection pooling, but it will be implemented
+soon.
+
+Primary Key Factories
+--------
+
+Defining your own primary key factory allows you to generate your own series of id's
+(this could f.ex be to use something like ISBN numbers). The generated the id needs to be a 12 byte long "string".
+
+Simple example below
+
+ // Custom factory (need to provide a 12 byte array);
+ CustomPKFactory = function() {}
+ CustomPKFactory.prototype = new Object();
+ CustomPKFactory.createPk = function() {
+ return new ObjectID("aaaaaaaaaaaa");
+ }
+
+ var p_client = new Db('integration_tests_20', new Server("127.0.0.1", 27017, {}), {'pk':CustomPKFactory});
+ p_client.open(function(err, p_client) {
+ p_client.dropDatabase(function(err, done) {
+ p_client.createCollection('test_custom_key', function(err, collection) {
+ collection.insert({'a':1}, function(err, docs) {
+ collection.find({'_id':new ObjectID("aaaaaaaaaaaa")}, function(err, cursor) {
+ cursor.toArray(function(err, items) {
+ test.assertEquals(1, items.length);
+
+ // Let's close the db
+ p_client.close();
+ });
+ });
+ });
+ });
+ });
+ });
+
+Strict mode
+--------
+
+Each database has an optional strict mode. If it is set then asking for a collection
+that does not exist will return an Error object in the callback. Similarly if you
+attempt to create a collection that already exists. Strict is provided for convenience.
+
+ var error_client = new Db('integration_tests_', new Server("127.0.0.1", 27017, {auto_reconnect: false}), {strict:true});
+ test.assertEquals(true, error_client.strict);
+
+ error_client.open(function(err, error_client) {
+ error_client.collection('does-not-exist', function(err, collection) {
+ test.assertTrue(err instanceof Error);
+ test.assertEquals("Collection does-not-exist does not exist. Currently in strict mode.", err.message);
+ });
+
+ error_client.createCollection('test_strict_access_collection', function(err, collection) {
+ error_client.collection('test_strict_access_collection', function(err, collection) {
+ test.assertTrue(collection instanceof Collection);
+ // Let's close the db
+ error_client.close();
+ });
+ });
+ });
+
+Documentation
+========
+
+If this document doesn't answer your questions, see the source of
+[Collection](https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/connection.py)
+or [Cursor](https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/cursor.py),
+or the documentation at MongoDB for query and update formats.
+
+Find
+--------
+
+The find method is actually a factory method to create
+Cursor objects. A Cursor lazily uses the connection the first time
+you call `nextObject`, `each`, or `toArray`.
+
+The basic operation on a cursor is the `nextObject` method
+that fetches the next object from the database. The convenience methods
+`each` and `toArray` call `nextObject` until the cursor is exhausted.
+
+Signatures:
+
+ collection.find(query, [fields], options);
+
+ cursor.nextObject(function(err, doc) {});
+ cursor.each(function(err, doc) {});
+ cursor.toArray(function(err, docs) {});
+
+ cursor.rewind() // reset the cursor to its initial state.
+
+Useful options of `find`:
+
+* **`limit`** and **`skip`** numbers used to control paging.
+* **`sort`** an array of sort preferences like this:
+`[['field1','asc'], ['field2','desc']]`. As a shorthand, ascending fields can
+be written as simply the field name instead of `['field','asc']`. Furthermore,
+if you are sorting by a single ascending field, you can smply enter the field
+name as a string without the surrounding array.
+* **`fields`** the fields to fetch (to avoid transferring the entire document)
+* **`tailable`** if true, makes the cursor [tailable](http://www.mongodb.org/display/DOCS/Tailable+Cursors).
+* **`batchSize`** The number of the subset of results to request the database
+to return for every request. This should initially be greater than 1 otherwise
+the database will automatically close the cursor. The batch size can be set to 1
+with `batchSize(n, function(err){})` after performing the initial query to the database.
+* **`hint`** See [Optimization: hint](http://www.mongodb.org/display/DOCS/Optimization#Optimization-Hint).
+* **`explain`** turns this into an explain query. You can also call
+`explain()` on any cursor to fetch the explanation.
+* **`snapshot`** prevents documents that are updated while the query is active
+from being returned multiple times. See more
+[details about query snapshots](http://www.mongodb.org/display/DOCS/How+to+do+Snapshotted+Queries+in+the+Mongo+Database).
+* **`timeout`** if false, asks MongoDb not to time out this cursor after an
+inactivity period.
+
+
+For information on how to create queries, see the
+[MongoDB section on querying](http://www.mongodb.org/display/DOCS/Querying).
+
+ var mongodb = require('mongodb');
+ var server = new mongodb.Server("127.0.0.1", 27017, {});
+ new mongodb.Db('test', server, {}).open(function (error, client) {
+ if (error) throw error;
+ var collection = new mongodb.Collection(client, 'test_collection');
+ collection.find({}, {limit:10}).toArray(function(err, docs) {
+ console.dir(docs);
+ });
+ });
+
+Insert
+--------
+
+Signature:
+
+ collection.insert(docs, options, [callback]);
+
+Useful options:
+
+* **`safe:true`** Should always set if you have a callback.
+
+See also: [MongoDB docs for insert](http://www.mongodb.org/display/DOCS/Inserting).
+
+ var mongodb = require('mongodb');
+ var server = new mongodb.Server("127.0.0.1", 27017, {});
+ new mongodb.Db('test', server, {}).open(function (error, client) {
+ if (error) throw error;
+ var collection = new mongodb.Collection(client, 'test_collection');
+ collection.insert({hello: 'world'}, {safe:true},
+ function(err, objects) {
+ if (err) console.warn(err.message);
+ if (err && err.message.indexOf('E11000 ') !== -1) {
+ // this _id was already inserted in the database
+ }
+ });
+ });
+
+Note that there's no reason to pass a callback to the insert or update commands
+unless you use the `safe:true` option. If you don't specify `safe:true`, then
+your callback will be called immediately. (fine for collecting some statistics,
+bad for most use cases (see "MongoDB is Web Scale")).
+
+Update; update and insert (upsert)
+--------
+
+The update operation will update the first document that matches your query
+(or all documents that match if you use `multi:true`).
+If `safe:true`, `upsert` is not set, and no documents match, your callback
+will be given an error.
+
+See the [MongoDB docs](http://www.mongodb.org/display/DOCS/Updating) for
+the modifier (`$inc`, etc.) formats.
+
+Signature:
+
+ collection.update(criteria, objNew, options, [callback]);
+
+Useful options:
+
+* **`safe:true`** Should always set if you have a callback.
+* **`multi:true`** If set, all matching documents are updated, not just the first.
+* **`upsert:true`** Atomically inserts the document if no documents matched.
+
+Example for `update`:
+
+ var mongodb = require('mongodb');
+ var server = new mongodb.Server("127.0.0.1", 27017, {});
+ new mongodb.Db('test', server, {}).open(function (error, client) {
+ if (error) throw error;
+ var collection = new mongodb.Collection(client, 'test_collection');
+ collection.update({hi: 'here'}, {$set: {hi: 'there'}}, {safe:true},
+ function(err) {
+ if (err) console.warn(err.message);
+ else console.log('successfully updated');
+ });
+ });
+
+Find and modify
+--------
+
+`findAndModify` is like `update`, but it also gives the updated document to
+your callback. But there are a few key differences between findAndModify and
+update:
+
+ 1. The signatures differ.
+ 2. You can only findAndModify a single item, not multiple items.
+ 3. The callback does not get an error when the item doesn't exist, just
+ an `undefined` object.
+
+Signature:
+
+ collection.findAndModify(query, sort, update, options, callback)
+
+The sort parameter is used to specify which object to operate on, if more than
+one document matches. It takes the same format as the cursor sort (see
+Connection.find above).
+
+See the
+[MongoDB docs for findAndModify](http://www.mongodb.org/display/DOCS/findAndModify+Command)
+for more details.
+
+Useful options:
+
+* **`remove:true`** set to a true to remove the object before returning
+* **`new:true`** set to true if you want to return the modified object rather than the original. Ignored for remove.
+* **`upsert:true`** Atomically inserts the document if no documents matched.
+
+Example for `findAndModify`:
+
+ var mongodb = require('mongodb');
+ var server = new mongodb.Server("127.0.0.1", 27017, {});
+ new mongodb.Db('test', server, {}).open(function (error, client) {
+ if (error) throw error;
+ var collection = new mongodb.Collection(client, 'test_collection');
+ collection.findAndModify({hello: 'world'}, [['_id','asc']], {$set: {hi: 'there'}}, {},
+ function(err, object) {
+ if (err) console.warn(err.message);
+ else console.dir(object); // undefined if no matching object exists.
+ });
+ });
+
+Find or insert
+--------
+
+TODO
+
+Save
+--------
+
+The `save` method is a shorthand for upsert if the document contains an
+`_id`, or an insert if there is no `_id`.
+
+Sponsors
+========
+Just as Felix Geisendörfer I'm also working on the driver for my own startup and this driver is a big project that also benefits other companies who are using MongoDB.
+
+If your company could benefit from a even better-engineered node.js mongodb driver I would appreciate any type of sponsorship you may be able to provide. All the sponsors will get a lifetime display in this readme, priority support and help on problems and votes on the roadmap decisions for the driver. If you are interested contact me on [christkv@gmail.com](mailto:christkv@gmail.com) for details.
+
+And I'm very thankful for code contributions. If you are interested in working on features please contact me so we can discuss API design and testing.
+
+Release Notes
+========
+
+See HISTORY
+
+Credits
+========
+
+1. [10gen](http://github.com/mongodb/mongo-ruby-driver/)
+2. [Google Closure Library](http://code.google.com/closure/library/)
+3. [Jonas Raoni Soares Silva](http://jsfromhell.com/classes/binary-parser)
+
+License
+========
+
+ Copyright 2009 - 2010 Christian Amor Kvalheim.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
View
34 node_modules/.npm/.cache/mongodb/0.9.4-3/package/benchmark/grid_fs_write_benchmark.js
@@ -0,0 +1,34 @@
+require.paths.unshift('../lib');
+
+var Db = require('mongodb').Db,
+ Server = require('mongodb').Server,
+ ObjectID = require('mongodb').ObjectID,
+ Cursor = require('mongodb').Cursor,
+ Collection = require('mongodb').Collection,
+ Buffer = require('buffer').Buffer,
+ GridStore = require('mongodb').GridStore,
+ sys = require('sys');
+
+var simulated_buffer = new Buffer(1024*1000*10).toString();
+
+new Db('grid_fs_write_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {}).open(function(err, new_client) {
+ new_client.dropDatabase(function(err, result) {
+ new_client.close();
+
+ for(var i = 0; i < 1; i++) {
+ new Db('grid_fs_write_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {}).open(function(err, client) {
+ var gridStore = new GridStore(client, "foobar" + i, "w");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write(simulated_buffer.toString(), function(err, gridStore) {
+ // sys.puts("========================== wrote file: " + "foobar" + i);
+ gridStore.close(function(err, result) {
+ client.close();
+ // sys.puts("========================== close file: " + "foobar" + i);
+ });
+ });
+ });
+ // write_files.push(writeFile)
+ });
+ }
+ })
+});
View
47 node_modules/.npm/.cache/mongodb/0.9.4-3/package/benchmark/streaming_benchmark.js
@@ -0,0 +1,47 @@
+require.paths.unshift('../lib');
+require.paths.unshift('../external-libs/bson');
+
+var Db = require('mongodb').Db,
+ Server = require('mongodb').Server,
+ Cursor = require('mongodb').Cursor,
+ Collection = require('mongodb').Collection,
+ sys = require('sys');
+var BSON = require('bson');
+
+var db = new Db('streaming_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {})
+// Set native deserializer
+db.bson_deserializer = BSON;
+db.bson_serializer = BSON;
+db.pkFactory = BSON.ObjectID;
+
+// Open the db
+db.open(function(err, client) {
+ client.collection('streaming_benchmark', function(err, collection) {
+ collection.remove({}, function(err, result) {
+ // Benchmark
+ var started_at = new Date().getTime();
+ // Add documents
+ for(var i = 0; i < 100000; i++) {
+ // for(var i = 0; i < 1000; i++) {
+ collection.save({'i':i, 'a':i, 'c':i, 'd':{'i':i}}, function(err, result){});
+ }
+ sys.puts("save recs: " + ((new Date().getTime() - started_at)/1000) + "seconds");
+
+ // Benchmark
+ var started_at = new Date().getTime();
+ var count = 0;
+ collection.find(function(err, cursor) {
+ var stream = cursor.streamRecords(function(er,item) {});
+ stream.addListener('end', function() {
+ client.close();
+ });
+ stream.addListener('data',function(data){
+ if(count == 0) started_at = new Date().getTime();
+ count++;
+ if ((count%10000)==0) sys.puts("recs:" + count + " :: " +
+ ((new Date().getTime() - started_at)/1000) + "seconds");
+ });
+ });
+ })
+ })
+});
View
61 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/admin.js
@@ -0,0 +1,61 @@
+GLOBAL.DEBUG = true;
+
+sys = require("sys");
+test = require("assert");
+
+var Db = require('../lib/mongodb').Db,
+ Connection = require('../lib/mongodb').Connection,
+ Server = require('../lib/mongodb').Server,
+ // BSON = require('../lib/mongodb').BSONPure;
+ BSON = require('../lib/mongodb').BSONNative;
+
+var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
+var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
+
+sys.puts("Connecting to " + host + ":" + port);
+var db = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db.open(function(err, db) {
+ db.dropDatabase(function(err, result){
+ db.dropCollection('test', function(err, result) {
+ db.createCollection('test', function(err, collection) {
+
+ // Erase all records in collection
+ collection.remove(function(err, collection) {
+ db.admin(function(err, admin) {
+
+ // Profiling level set/get
+ admin.profilingLevel(function(err, profilingLevel) {
+ sys.puts("Profiling level: " + profilingLevel);
+ });
+
+ // Start profiling everything
+ admin.setProfilingLevel('all', function(err, level) {
+ sys.puts("Profiling level: " + level);
+
+ // Read records, creating a profiling event
+ collection.find(function(err, cursor) {
+ cursor.toArray(function(err, items) {
+
+ // Stop profiling
+ admin.setProfilingLevel('off', function(err, level) {
+ // Print all profiling info
+ admin.profilingInfo(function(err, info) {
+ sys.puts(sys.inspect(info));
+
+ // Validate returns a hash if all is well or return an error has if there is a
+ // problem.
+ admin.validateCollection(collection.collectionName, function(err, result) {
+ sys.puts(result.result);
+ db.close();
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+});
View
109 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/blog.js
@@ -0,0 +1,109 @@
+GLOBAL.DEBUG = true;
+
+sys = require("sys");
+test = require("assert");
+
+var Db = require('../lib/mongodb').Db,
+ Connection = require('../lib/mongodb').Connection,
+ Server = require('../lib/mongodb').Server,
+ // BSON = require('../lib/mongodb').BSONPure;
+ BSON = require('../lib/mongodb').BSONNative;
+
+var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
+var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
+
+var LINE_SIZE = 120;
+
+sys.puts("Connecting to " + host + ":" + port);
+var db = new Db('node-mongo-blog', new Server(host, port, {}), {native_parser:true});
+db.open(function(err, db) {
+ db.dropDatabase(function(err, result) {
+ sys.puts("===================================================================================");
+ sys.puts(">> Adding Authors");
+ db.collection('authors', function(err, collection) {
+ collection.createIndex(["meta", ['_id', 1], ['name', 1], ['age', 1]], function(err, indexName) {
+ sys.puts("===================================================================================");
+ var authors = {};
+
+ // Insert authors
+ collection.insert([{'name':'William Shakespeare', 'email':'william@shakespeare.com', 'age':587},
+ {'name':'Jorge Luis Borges', 'email':'jorge@borges.com', 'age':123}], function(err, docs) {
+ docs.forEach(function(doc) {
+ sys.puts(sys.inspect(doc));
+ authors[doc.name] = doc;
+ });
+ });
+
+ sys.puts("===================================================================================");
+ sys.puts(">> Authors ordered by age ascending");
+ sys.puts("===================================================================================");
+ collection.find({}, {'sort':[['age', 1]]}, function(err, cursor) {
+ cursor.each(function(err, author) {
+ if(author != null) {
+ sys.puts("[" + author.name + "]:[" + author.email + "]:[" + author.age + "]");
+ } else {
+ sys.puts("===================================================================================");
+ sys.puts(">> Adding users");
+ sys.puts("===================================================================================");
+ db.collection('users', function(err, userCollection) {
+ var users = {};
+
+ userCollection.insert([{'login':'jdoe', 'name':'John Doe', 'email':'john@doe.com'},
+ {'login':'lsmith', 'name':'Lucy Smith', 'email':'lucy@smith.com'}], function(err, docs) {
+ docs.forEach(function(doc) {
+ sys.puts(sys.inspect(doc));
+ users[doc.login] = doc;
+ });
+ });
+
+ sys.puts("===================================================================================");
+ sys.puts(">> Users ordered by login ascending");
+ sys.puts("===================================================================================");
+ userCollection.find({}, {'sort':[['login', 1]]}, function(err, cursor) {
+ cursor.each(function(err, user) {
+ if(user != null) {
+ sys.puts("[" + user.login + "]:[" + user.name + "]:[" + user.email + "]");
+ } else {
+ sys.puts("===================================================================================");
+ sys.puts(">> Adding articles");
+ sys.puts("===================================================================================");
+ db.collection('articles', function(err, articlesCollection) {
+ articlesCollection.insert([
+ { 'title':'Caminando por Buenos Aires',
+ 'body':'Las callecitas de Buenos Aires tienen ese no se que...',
+ 'author_id':authors['Jorge Luis Borges']._id},
+ { 'title':'I must have seen thy face before',
+ 'body':'Thine eyes call me in a new way',
+ 'author_id':authors['William Shakespeare']._id,
+ 'comments':[{'user_id':users['jdoe']._id, 'body':"great article!"}]
+ }
+ ], function(err, docs) {
+ docs.forEach(function(doc) {
+ sys.puts(sys.inspect(doc));
+ });
+ })
+
+ sys.puts("===================================================================================");
+ sys.puts(">> Articles ordered by title ascending");
+ sys.puts("===================================================================================");
+ articlesCollection.find({}, {'sort':[['title', 1]]}, function(err, cursor) {
+ cursor.each(function(err, article) {
+ if(article != null) {
+ sys.puts("[" + article.title + "]:[" + article.body + "]:[" + article.author_id.toHexString() + "]");
+ sys.puts(">> Closing connection");
+ db.close();
+ }
+ });
+ });
+ });
+ }
+ });
+ });
+ });
+ }
+ });
+ });
+ });
+ });
+ });
+});
View
34 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/capped.js
@@ -0,0 +1,34 @@
+GLOBAL.DEBUG = true;
+
+sys = require("sys");
+test = require("assert");
+
+var Db = require('../lib/mongodb').Db,
+ Connection = require('../lib/mongodb').Connection,
+ Server = require('../lib/mongodb').Server,
+ // BSON = require('../lib/mongodb').BSONPure;
+ BSON = require('../lib/mongodb').BSONNative;
+
+var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
+var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
+
+sys.puts("Connecting to " + host + ":" + port);
+var db = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db.open(function(err, db) {
+ db.dropCollection('test', function(err, result) {
+ // A capped collection has a max size and optionally a max number of records.
+ // Old records get pushed out by new ones once the size or max num records is
+ // reached.
+ db.createCollection('test', {'capped':true, 'size':1024, 'max':12}, function(err, collection) {
+ for(var i = 0; i < 100; i++) { collection.insert({'a':i}); }
+
+ // We will only see the last 12 records
+ collection.find(function(err, cursor) {
+ cursor.toArray(function(err, items) {
+ sys.puts("The number of records: " + items.length);
+ db.close();
+ })
+ })
+ });
+ });
+});
View
76 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/cursor.js
@@ -0,0 +1,76 @@
+GLOBAL.DEBUG = true;
+
+sys = require("sys");
+test = require("assert");
+
+var Db = require('../lib/mongodb').Db,
+ Connection = require('../lib/mongodb').Connection,
+ Server = require('../lib/mongodb').Server,
+ // BSON = require('../lib/mongodb').BSONPure;
+ BSON = require('../lib/mongodb').BSONNative;
+
+var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
+var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
+
+sys.puts("Connecting to " + host + ":" + port);
+var db = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db.open(function(err, db) {
+ db.collection('test', function(err, collection) {
+ // Erase all records from collection, if any
+ collection.remove(function(err, collection) {
+
+ // Insert 3 records
+ for(var i = 0; i < 3; i++) {
+ collection.insert({'a':i});
+ }
+
+ // Cursors don't run their queries until you actually attempt to retrieve data
+ // from them.
+
+ // Find returns a Cursor, which is Enumerable. You can iterate:
+ collection.find(function(err, cursor) {
+ cursor.each(function(err, item) {
+ if(item != null) sys.puts(sys.inspect(item));
+ });
+ });
+
+ // You can turn it into an array
+ collection.find(function(err, cursor) {
+ cursor.toArray(function(err, items) {
+ sys.puts("count: " + items.length);
+ });
+ });
+
+ // You can iterate after turning it into an array (the cursor will iterate over
+ // the copy of the array that it saves internally.)
+ collection.find(function(err, cursor) {
+ cursor.toArray(function(err, items) {
+ cursor.each(function(err, item) {
+ if(item != null) sys.puts(sys.inspect(item));
+ });
+ });
+ });
+
+ // You can get the next object
+ collection.find(function(err, cursor) {
+ cursor.nextObject(function(err, item) {
+ if(item != null) sys.puts(sys.inspect(item));
+ });
+ });
+
+ // next_object returns null if there are no more objects that match
+ collection.find(function(err, cursor) {
+ cursor.nextObject(function(err, item) {
+ cursor.nextObject(function(err, item) {
+ cursor.nextObject(function(err, item) {
+ cursor.nextObject(function(err, item) {
+ sys.puts("nextObject returned: " + sys.inspect(item));
+ db.close();
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+});
View
156 node_modules/.npm/.cache/mongodb/0.9.4-3/package/examples/gridfs.js
@@ -0,0 +1,156 @@
+GLOBAL.DEBUG = true;
+
+sys = require("sys");
+test = require("assert");
+
+var Db = require('../lib/mongodb').Db,
+ Connection = require('../lib/mongodb').Connection,
+ Server = require('../lib/mongodb').Server,
+ GridStore = require('../lib/mongodb').GridStore,
+ // BSON = require('../lib/mongodb').BSONPure;
+ BSON = require('../lib/mongodb').BSONNative;
+
+var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
+var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
+
+sys.puts(">> Connecting to " + host + ":" + port);
+var db1 = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db1.open(function(err, db) {
+ // Write a new file
+ var gridStore = new GridStore(db, "foobar", "w");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write("hello world!", function(err, gridStore) {
+ gridStore.close(function(err, result) {
+ // Read the file and dump the contents
+ dump(db, 'foobar');
+
+ // Append more data
+ gridStore = new GridStore(db, 'foobar', "w+");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write('\n', function(err, gridStore) {
+ gridStore.puts('line two', function(err, gridStore) {
+ gridStore.close(function(err, result) {
+ dump(db, 'foobar');
+
+ // Overwrite
+ gridStore = new GridStore(db, 'foobar', "w");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write('hello, sailor!', function(err, gridStore) {
+ gridStore.close(function(err, result) {
+ dump(db, 'foobar', function() {
+ db.close();
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+});
+
+var db2 = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db2.open(function(err, db) {
+ // File existence tests
+ var gridStore = new GridStore(db, "foobar2", "w");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write( 'hello sailor', function(err, gridStore) {
+ gridStore.close(function(err, result) {
+ GridStore.exist(db, 'foobar2', function(err, result) {
+ sys.puts("File 'foobar2' exists: " + result);
+ });
+
+ GridStore.exist(db, 'does-not-exist', function(err, result) {
+ sys.puts("File 'does-not-exist' exists: " + result);
+ });
+
+ // Read with offset(uses seek)
+ GridStore.read(db, 'foobar2', 6, 7, function(err, data) {
+ sys.puts(data);
+ });
+
+ // Rewind/seek/tell
+ var gridStore2 = new GridStore(db, 'foobar2', 'w');
+ gridStore2.open(function(err, gridStore) {
+ gridStore.write('hello, world!', function(err, gridStore){});
+ gridStore.rewind(function(){});
+ gridStore.write('xyzzz', function(err, gridStore){});
+ gridStore.tell(function(tell) {
+ sys.puts("tell: " + tell); // Should be 5
+ });
+ gridStore.seek(4, function(err, gridStore){});
+ gridStore.write('y', function(){});
+ gridStore.close(function() {
+ dump(db, 'foobar2');
+
+ // Unlink file (delete)
+ GridStore.unlink(db, 'foobar2', function(err, gridStore) {
+ GridStore.exist(db, 'foobar2', function(err, result) {
+ sys.puts("File 'foobar2' exists: " + result);
+ db.close();
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+});
+
+var db3 = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
+db3.open(function(err, db) {
+ // Metadata
+ var gridStore = new GridStore(db, "foobar3", "w");
+ gridStore.open(function(err, gridStore) {
+ gridStore.write('hello, world!', function(err, gridStore){});
+ gridStore.close(function(err, gridStore) {
+ gridStore = new GridStore(db, 'foobar3', "r");
+ gridStore.open(function(err, gridStore) {
+ sys.puts("contentType: " + gridStore.contentType);
+ sys.puts("uploadDate: " + gridStore.uploadDate);
+ sys.puts("chunkSize: " + gridStore.chunkSize);
+ sys.puts("metadata: " + gridStore.metadata);
+ });
+
+ // Add some metadata
+ gridStore = new GridStore(db, 'foobar3', "w+");
+ gridStore.open(function(err, gridStore) {
+ gridStore.contentType = 'text/xml';
+ gridStore.metadata = {'a':1};
+ gridStore.close(function(err, gridStore) {
+ // Print the metadata
+ gridStore = new GridStore(db, 'foobar3', "r");
+ gridStore.open(function(err, gridStore) {
+ sys.puts("contentType: " + gridStore.contentType);
+ sys.puts("uploadDate: " + gridStore.uploadDate);
+ sys.puts("chunkSize: " + gridStore.chunkSize);
+ sys.puts("metadata: " + gridStore.metadata);
+ db.close();
+ });
+ });
+ });
+ });
+ });
+
+ // You can also set meta data when initially writing to a file
+ // setting root means that the file and its chunks are stored in a different root
+ // collection: instead of gridfs.files and gridfs.chunks, here we use
+ // my_files.files and my_files.chunks
+ var gridStore = new GridStore(db, "foobar3", "w", {'content_type':'text/plain',
+ 'metadata'