Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

Commit

Permalink
Extract map fn into a real function
Browse files Browse the repository at this point in the history
  • Loading branch information
SCdF committed Apr 20, 2016
1 parent 1ddae89 commit 4fab4d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions migrations/convert-bad-dob-format.js
@@ -1,12 +1,14 @@
var db = require('../db'),
moment = require('moment');

/* jshint ignore:start */
// (it's more readable to use double quotes)
var map = function(doc) {
if (doc.type === 'person' && doc.date_of_birth && doc.date_of_birth.indexOf(' ') >= 0) {
emit(1);
}
};
var temporaryView = {
'map': "function(doc) { if (doc.type === 'person' && doc.date_of_birth && doc.date_of_birth.indexOf(' ') >= 0) { emit(1); }}"
'map': map.toString()

This comment has been minimized.

Copy link
@mandric

mandric Apr 21, 2016

Contributor

(OCD still twitching)

};
/* jshint ignore:end */

module.exports = {
name: 'convert-bad-dob-format',
Expand Down

0 comments on commit 4fab4d1

Please sign in to comment.