Permalink
Browse files

Signed-off-by: unknown <Administrator@jrj-wangpeng2011422.(none)>

  • Loading branch information...
1 parent 0c5c51d commit 9f773ebb811ea2c6682737753a6267fd21b072d1 samoin committed Apr 1, 2012
Showing with 73,273 additions and 33 deletions.
  1. +3 −0 .dbshell
  2. +1 −1 client.config.js
  3. +1 −1 client.js
  4. +11 −0 model/base.js
  5. +12 −0 model/oplog.js
  6. +6 −6 model/oplog.rs.js
  7. +5 −0 node_modules/mongoose2/.npmignore
  8. +4 −0 node_modules/mongoose2/.travis.yml
  9. +831 −0 node_modules/mongoose2/History.md
  10. +25 −0 node_modules/mongoose2/Makefile
  11. +356 −0 node_modules/mongoose2/README.md
  12. +60 −0 node_modules/mongoose2/benchmarks/clone.js
  13. +128 −0 node_modules/mongoose2/benchmarks/index.js
  14. +149 −0 node_modules/mongoose2/benchmarks/mem.js
  15. +29 −0 node_modules/mongoose2/docs/defaults.md
  16. +79 −0 node_modules/mongoose2/docs/embedded-documents.md
  17. +54 −0 node_modules/mongoose2/docs/errors.md
  18. +124 −0 node_modules/mongoose2/docs/finding-documents.md
  19. +52 −0 node_modules/mongoose2/docs/getters-setters.md
  20. +43 −0 node_modules/mongoose2/docs/indexes.md
  21. +55 −0 node_modules/mongoose2/docs/methods-statics.md
  22. +61 −0 node_modules/mongoose2/docs/middleware.md
  23. +148 −0 node_modules/mongoose2/docs/migration-guide.md
  24. +142 −0 node_modules/mongoose2/docs/model-definition.md
  25. +38 −0 node_modules/mongoose2/docs/plugins.md
  26. +166 −0 node_modules/mongoose2/docs/populate.md
  27. +362 −0 node_modules/mongoose2/docs/query.md
  28. +6 −0 node_modules/mongoose2/docs/querystream.md
  29. +197 −0 node_modules/mongoose2/docs/schematypes.md
  30. +92 −0 node_modules/mongoose2/docs/validation.md
  31. +84 −0 node_modules/mongoose2/docs/virtuals.md
  32. +102 −0 node_modules/mongoose2/examples/schema.js
  33. +7 −0 node_modules/mongoose2/index.js
  34. +167 −0 node_modules/mongoose2/lib/collection.js
  35. +517 −0 node_modules/mongoose2/lib/connection.js
  36. +1,223 −0 node_modules/mongoose2/lib/document.js
  37. +8 −0 node_modules/mongoose2/lib/drivers/node-mongodb-native/binary.js
  38. +176 −0 node_modules/mongoose2/lib/drivers/node-mongodb-native/collection.js
  39. +106 −0 node_modules/mongoose2/lib/drivers/node-mongodb-native/connection.js
  40. +43 −0 node_modules/mongoose2/lib/drivers/node-mongodb-native/objectid.js
  41. +25 −0 node_modules/mongoose2/lib/error.js
  42. +368 −0 node_modules/mongoose2/lib/index.js
  43. +917 −0 node_modules/mongoose2/lib/model.js
  44. +70 −0 node_modules/mongoose2/lib/namedscope.js
  45. +145 −0 node_modules/mongoose2/lib/promise.js
  46. +1,527 −0 node_modules/mongoose2/lib/query.js
  47. +179 −0 node_modules/mongoose2/lib/querystream.js
  48. +565 −0 node_modules/mongoose2/lib/schema.js
  49. +232 −0 node_modules/mongoose2/lib/schema/array.js
  50. +59 −0 node_modules/mongoose2/lib/schema/boolean.js
  51. +106 −0 node_modules/mongoose2/lib/schema/buffer.js
  52. +116 −0 node_modules/mongoose2/lib/schema/date.js
  53. +141 −0 node_modules/mongoose2/lib/schema/documentarray.js
  54. +22 −0 node_modules/mongoose2/lib/schema/index.js
  55. +63 −0 node_modules/mongoose2/lib/schema/mixed.js
  56. +142 −0 node_modules/mongoose2/lib/schema/number.js
  57. +126 −0 node_modules/mongoose2/lib/schema/objectid.js
  58. +180 −0 node_modules/mongoose2/lib/schema/string.js
  59. +32 −0 node_modules/mongoose2/lib/schemadefault.js
  60. +428 −0 node_modules/mongoose2/lib/schematype.js
  61. +179 −0 node_modules/mongoose2/lib/statemachine.js
  62. +422 −0 node_modules/mongoose2/lib/types/array.js
  63. +171 −0 node_modules/mongoose2/lib/types/buffer.js
  64. +133 −0 node_modules/mongoose2/lib/types/documentarray.js
  65. +103 −0 node_modules/mongoose2/lib/types/embedded.js
  66. +14 −0 node_modules/mongoose2/lib/types/index.js
  67. +84 −0 node_modules/mongoose2/lib/types/number.js
  68. +12 −0 node_modules/mongoose2/lib/types/objectid.js
  69. +434 −0 node_modules/mongoose2/lib/utils.js
  70. +74 −0 node_modules/mongoose2/lib/virtualtype.js
  71. +2 −0 node_modules/mongoose2/node_modules/hooks/.npmignore
  72. +9 −0 node_modules/mongoose2/node_modules/hooks/Makefile
  73. +306 −0 node_modules/mongoose2/node_modules/hooks/README.md
  74. +134 −0 node_modules/mongoose2/node_modules/hooks/hooks.alt.js
  75. +161 −0 node_modules/mongoose2/node_modules/hooks/hooks.js
  76. +51 −0 node_modules/mongoose2/node_modules/hooks/package.json
  77. +685 −0 node_modules/mongoose2/node_modules/hooks/test.js
  78. +5 −0 node_modules/mongoose2/node_modules/mongodb/.travis.yml
  79. +71 −0 node_modules/mongoose2/node_modules/mongodb/Makefile
  80. +45 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/Makefile
  81. +2,165 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/bson.cc
  82. +105 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/bson.h
  83. +20 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/index.js
  84. +349 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/test/test_bson.js
  85. +218 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/test/test_full_bson.js
  86. +132 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/test/test_stackless_bson.js
  87. +39 −0 node_modules/mongoose2/node_modules/mongodb/external-libs/bson/wscript
  88. +1 −0 node_modules/mongoose2/node_modules/mongodb/index.js
  89. +40 −0 node_modules/mongoose2/node_modules/mongodb/install.js
  90. +390 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/admin.js
  91. +1,504 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/collection.js
  92. +27 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/base_command.js
  93. +205 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/db_command.js
  94. +111 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/delete_command.js
  95. +83 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/get_more_command.js
  96. +141 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/insert_command.js
  97. +98 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/kill_cursor_command.js
  98. +209 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/query_command.js
  99. +174 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/commands/update_command.js
  100. +414 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/connection.js
  101. +259 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/connection_pool.js
  102. +23 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/connection_utils.js
  103. +972 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/repl_set_servers.js
  104. +640 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/server.js
  105. +125 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/strategies/ping_strategy.js
  106. +40 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/connection/strategies/statistics_strategy.js
  107. +702 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/cursor.js
  108. +141 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/cursorstream.js
  109. +1,788 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/db.js
  110. +208 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/gridfs/chunk.js
  111. +98 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/gridfs/grid.js
  112. +1,109 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/gridfs/gridstore.js
  113. +179 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/gridfs/readstream.js
  114. +142 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/index.js
  115. +131 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js
  116. +74 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/utils.js
  117. +1,790 −0 node_modules/mongoose2/node_modules/mongodb/lib/mongodb/¸´¼þ (2) db.js
  118. +5 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/.travis.yml
  119. +31 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/Makefile
  120. 0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/README
  121. +28 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/ext/Makefile
  122. +2,165 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/ext/bson.cc
  123. +105 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/ext/bson.h
  124. +20 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/ext/index.js
  125. +39 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/ext/wscript
  126. +41 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/install.js
  127. +336 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/binary.js
  128. +387 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/binary_parser.js
  129. +1,483 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/bson.js
  130. +27 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/code.js
  131. +33 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/db_ref.js
  132. +35 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/double.js
  133. +123 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/float_parser.js
  134. +74 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/index.js
  135. +856 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/long.js
  136. +15 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/max_key.js
  137. +15 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/min_key.js
  138. +251 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/objectid.js
  139. +50 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/symbol.js
  140. +855 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/lib/bson/timestamp.js
  141. +58 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/package.json
  142. +242 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/browser/bson_test.js
  143. +2,034 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/browser/nodeunit.js
  144. +13 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/browser/suite2.js
  145. +7 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/browser/suite3.js
  146. +30 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/browser/test.html
  147. +240 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/bson_array_test.js
  148. +459 −0 ...odules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/bson_parser_comparision_test.js
  149. +1,591 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/bson_test.js
  150. +392 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/bson_typed_array_test.js
  151. BIN node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/data/test_gs_weird_bug.png
  152. +295 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/test_full_bson.js
  153. +80 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/test/node/tools/utils.js
  154. +8 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/gleak.js
  155. +20 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/MIT.LICENSE
  156. +190 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine-html.js
  157. +166 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine.css
  158. +2,476 −0 node_modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine.js
  159. BIN ..._modules/mongoose2/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine_favicon.png
  160. +214 −0 node_modules/mongoose2/node_modules/mongodb/package.json
  161. +9,928 −0 node_modules/mongoose2/node_modules/mongodb/valgrind.log
  162. +52 −0 node_modules/mongoose2/package.json
  163. +3 −0 node_modules/mongoose2/support/expresso/.gitmodules
  164. +3 −0 node_modules/mongoose2/support/expresso/.npmignore
  165. +128 −0 node_modules/mongoose2/support/expresso/History.md
  166. +53 −0 node_modules/mongoose2/support/expresso/Makefile
  167. +61 −0 node_modules/mongoose2/support/expresso/Readme.md
  168. +874 −0 node_modules/mongoose2/support/expresso/bin/expresso
  169. +1,080 −0 node_modules/mongoose2/support/expresso/docs/api.html
  170. +377 −0 node_modules/mongoose2/support/expresso/docs/index.html
  171. +290 −0 node_modules/mongoose2/support/expresso/docs/index.md
  172. +3 −0 node_modules/mongoose2/support/expresso/docs/layout/foot.html
  173. +42 −0 node_modules/mongoose2/support/expresso/docs/layout/head.html
  174. +4 −0 node_modules/mongoose2/support/expresso/lib/bar.js
  175. +16 −0 node_modules/mongoose2/support/expresso/lib/foo.js
  176. +12 −0 node_modules/mongoose2/support/expresso/package.json
  177. +91 −0 node_modules/mongoose2/support/expresso/test/assert.test.js
  178. +12 −0 node_modules/mongoose2/support/expresso/test/async.test.js
  179. +13 −0 node_modules/mongoose2/support/expresso/test/bar.test.js
  180. +14 −0 node_modules/mongoose2/support/expresso/test/foo.test.js
  181. +109 −0 node_modules/mongoose2/support/expresso/test/http.test.js
  182. +39 −0 node_modules/mongoose2/support/expresso/test/serial/async.test.js
  183. +48 −0 node_modules/mongoose2/support/expresso/test/serial/http.test.js
  184. +116 −0 node_modules/mongoose2/test/collection.test.js
  185. +145 −0 node_modules/mongoose2/test/common.js
  186. +310 −0 node_modules/mongoose2/test/connection.test.js
  187. +36 −0 node_modules/mongoose2/test/crash.test.js
  188. +178 −0 node_modules/mongoose2/test/document.strict.test.js
  189. +912 −0 node_modules/mongoose2/test/document.test.js
  190. +63 −0 node_modules/mongoose2/test/drivers/node-mongodb-native/collection.test.js
  191. +7 −0 node_modules/mongoose2/test/dropdb.js
  192. +235 −0 node_modules/mongoose2/test/index.test.js
  193. +2,352 −0 node_modules/mongoose2/test/model.querying.test.js
  194. +1,528 −0 node_modules/mongoose2/test/model.ref.test.js
  195. +232 −0 node_modules/mongoose2/test/model.stream.test.js
  196. +4,682 −0 node_modules/mongoose2/test/model.test.js
  197. +526 −0 node_modules/mongoose2/test/model.update.test.js
  198. +253 −0 node_modules/mongoose2/test/namedscope.test.js
  199. +167 −0 node_modules/mongoose2/test/promise.test.js
  200. +890 −0 node_modules/mongoose2/test/query.test.js
  201. +105 −0 node_modules/mongoose2/test/schema.onthefly.test.js
  202. +978 −0 node_modules/mongoose2/test/schema.test.js
  203. +216 −0 node_modules/mongoose2/test/shard.test.js
  204. +551 −0 node_modules/mongoose2/test/types.array.test.js
  205. +350 −0 node_modules/mongoose2/test/types.buffer.test.js
  206. +197 −0 node_modules/mongoose2/test/types.document.test.js
  207. +132 −0 node_modules/mongoose2/test/types.documentarray.test.js
  208. +37 −0 node_modules/mongoose2/test/types.number.test.js
  209. +196 −0 node_modules/mongoose2/test/utils.test.js
  210. +11 −0 node_modules/mongoose2/test/zzlast.test.js
  211. +4 −3 server.config.js
  212. +66 −22 server.js
View
@@ -1,3 +1,6 @@
use local
show collections
db.oplog.rs.find()
+use local
+show collections
+db.oplog.rs.find()
View
@@ -1,5 +1,5 @@
module.exports = {
server_port : 8081,
server_host : "127.0.0.1",
- secure_key : {name : "ty1" , key : "1234567890ty1"}
+ secure_key : {name : "ty2" , key : "1234567890ty2"}
};
View
@@ -10,7 +10,7 @@ client.connect(PORT , HOST , function(){
client.write('{type:1,info:' + JSON.stringify(KEY) + '}');
});
client.on("data", function(data){
- console.log(data.toString());
+ console.log(data);
});
client.on("end", function(){
console.log("client disconnected");
View
@@ -0,0 +1,11 @@
+var mongoose = require('mongoose'),
+ Schema = mongoose.Schema,
+ ObjectId = Schema.ObjectId;
+var config = require("../server.config") || {};
+var SERVER_DB = config.server_db_info || "";
+//console.log(SERVER_DB);
+mongoose.connect(SERVER_DB);
+// 将参数继续暴露给后续的进行引用,减少require代码
+exports.mongoose = mongoose;
+exports.Schema = Schema;
+exports.ObjectId = ObjectId;
View
@@ -0,0 +1,12 @@
+var base = require("./base");
+OplogSchema = new base.Schema({
+ cluster_name : {type : String},
+ last_flag : {type : Number},
+ cluster_ischanged : {type : Boolean}
+});
+var modelName = "oplog",
+collName = "oplog";
+base.mongoose.model(modelName,OplogSchema,collName);
+var Model = base.mongoose.model(modelName,collName);
+exports.dao = Model;
+exports.mongoose = base.mongoose;
View
@@ -1,8 +1,8 @@
-var mongoose = require('mongoose'),
+var mongoose = require('mongoose2'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var OplogSchema = new mongoose.Schema({
- ts : {type : Schema.Types.Mixed},
+ ts : {type : Number},
h : {type : Number},
op : {type : String},
ns : {type : String},
@@ -11,11 +11,11 @@ var OplogSchema = new mongoose.Schema({
});
var modelName = "oplog.rs",
collName = "oplog.rs";
-mongoose.model(modelName,OplogSchema,collName);
-var Model = mongoose.model(modelName,collName);
-exports.dao = Model;
+//mongoose.model(modelName,OplogSchema,collName);
+//var Model = mongoose.model(modelName,collName);
+//exports.dao = Model;
// 将参数继续暴露给后续的进行引用,减少require代码
-exports.mongouris = "";
+//exports.mongouris = "";
exports.schema = OplogSchema;
exports.modelName = modelName;
exports.collName = collName;
@@ -0,0 +1,5 @@
+lib-cov
+**.swp
+*.sw*
+node_modules/
+*.orig
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
Oops, something went wrong.

0 comments on commit 9f773eb

Please sign in to comment.