block-sequence-mongo
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Change Log | ||
## [Unreleased] | ||
## [1.0.1] | ||
### Changed | ||
- Fixed race condition which could result in duplicate sequences | ||
## [1.0.0] | ||
### Changed | ||
- General Tidy Up | ||
The format is based on [Keep a Changelog](http://keepachangelog.com/) |
@@ -27,2 +27,4 @@ var debug = require('debug')('block-sequence:mongo') | ||
function(err, result) { | ||
// Turns out there's no such thing as an atomic upsert in mongo | ||
if (err && err.code === 11000) return ensure(options, cb) | ||
if (err) return cb(err) | ||
@@ -73,4 +75,7 @@ cb(null, _.chain({}) | ||
debug('Ensuring gs_block_sequence collection') | ||
collection = db.collection('gs_block_sequence') | ||
collection.createIndex('gs_block_sequence_name', { name: 1 }, { unique:true, w:1}, cb) | ||
db.collection('gs_block_sequence', function(err, _collection) { | ||
collection = _collection | ||
collection = db.collection('gs_block_sequence') | ||
collection.createIndex({ name: 1 }, { unique: true, w: 1 }, cb) | ||
}) | ||
} | ||
@@ -77,0 +82,0 @@ |
{ | ||
"name": "block-sequence-mongo", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A mongo implementation of block-sequence", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"block-sequence-compliance-tests": "^1.1.0", | ||
"block-sequence-compliance-tests": "^1.2.0", | ||
"codeclimate-test-reporter": "^0.4.0", | ||
@@ -27,0 +27,0 @@ "eslint": "^3.12.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7818
11
92