Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
tothradoslav committed Oct 18, 2017
1 parent 349bdda commit d92117b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions client/components/EditDocument.jsx
Expand Up @@ -51,9 +51,10 @@ EditDocument = React.createClass({
return false;
}
const documentData = this.props.document.value;

Meteor.call('updateDocument', this.props.collection._id, documentData._id, data, (error, result) => {
this.props.onSave();

var self = this;
Meteor.call('updateDocument', this.props.collection._id, documentData._id, data, function(error, result) {
self.props.onSave();
});
}
});
Expand Down
1 change: 0 additions & 1 deletion lib/helpers.js
Expand Up @@ -189,7 +189,6 @@ processJson = function(json) {

// any date #2017-10-03
var matches = json.match(new RegExp('\#[0-9]{4}\-[0-9]{2}\-[0-9]{2}', 'g'));
log(matches)
if (matches) {
_.each(matches, function(match) {
json = json.replace(match, '{"$date": ' + moment(match.replace('#', ''), 'YYYY-MM-DD').valueOf() + '}',)
Expand Down
5 changes: 3 additions & 2 deletions lib/mongoUriParser.js
Expand Up @@ -38,8 +38,9 @@ MongodbUriParser.parse = function parse(uri) {
var uriObject = {};

var i = uri.indexOf('://');
if (i < 0) {
throw new Error('No scheme found in URI ' + uri);
if (uri.indexOf('://') < 0) {
uri = 'mongodb://' + uri;
// throw new Error('No scheme found in URI ' + uri);
}
uriObject.scheme = uri.substring(0, i);
var rest = uri.substring(i + 3);
Expand Down
3 changes: 1 addition & 2 deletions server/methods.js
Expand Up @@ -253,8 +253,7 @@ Meteor.methods({

let updatedCount = updateWrapper();
db.close();

return updatedCount;
return updatedCount.result ? (updatedCount.result.nModified || 1) : 1 ;
},

updateDocuments(collectionId, filter, updateJson) {
Expand Down

0 comments on commit d92117b

Please sign in to comment.