How to use the json.length function in json

To help you get started, we’ve selected a few json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / parsoid / tests / server / importJson.js View on Github external
var loadJSON = function(json, options) {
	var titles = require(json);

	db.query('START TRANSACTION;');

	for (var i = 0; i < titles.length; i++) {
		insertRecord(titles[i], options.prefix || 'enwiki');
	}

	db.query('COMMIT;');

	waitingCount -= 0.5;
	if (waitingCount <= 0) {
		console.log('Done!');
	}
};
github gwicke / testreduce / articles / importJson.js View on Github external
var loadJSON = function( json, options ) {
	var i, titles = require( json );

	db.query( 'START TRANSACTION;' );

	for ( i = 0; i < titles.length; i++ ) {
		insertRecord( titles[i], options.prefix || 'en' );
	}

	db.query( 'COMMIT;' );

	waitingCount -= 0.5;
	if ( waitingCount <= 0 ) {
		console.log( 'Done!' );
	}
};