| 7 | exports.Driver = Driver; |
| 8 | |
| 9 | function Driver(config, connection, opts) { |
| 10 | this.client = new mongodb.MongoClient(); |
| 11 | this.db = null; |
| 12 | this.config = config || {}; |
| 13 | this.opts = opts; |
| 14 | |
| 15 | if (!this.config.timezone) { |
| 16 | this.config.timezone = "local"; |
| 17 | } |
| 18 | |
| 19 | this.opts.settings.set("properties.primary_key", "_id"); |
| 20 | this.opts.settings.set("properties.association_key", function (name, field) { |
| 21 | return name + "_" + field.replace(/^_+/, ''); |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | Driver.prototype.sync = function (opts, cb) { |
| 26 | this.db.createCollection(opts.table, function (err, collection) { |