modules/orionode/lib/shared/db/sharedProjects.js
function addProject(project) {
		var hub = generateUniqueHubId();
		//TODO Also add name of project owner? Replace by projectJSON all over the file.
		var query = sharedProject.findOne({location: project});
		return query.exec()
		.then(function(doc) {
			return doc ? Promise.resolve(doc) : sharedProject.create({location: project, hubid: hub});
		});
	}
function addProject(project) {
		var hub = generateUniqueHubId();
		//TODO Also add name of project owner? Replace by projectJSON all over the file.
		var query = sharedProject.findOne({location: project});
		return query.exec()
		.then(function(doc) {
			return doc ? Promise.resolve(doc) : sharedProject.create({location: project, hubid: hub});
		});
	}
function addProject ( project ) { var hub = generateUniqueHubId ( ) ; //TODO Also add name of project owner? Replace by projectJSON all over the file. var query = sharedProject . findOne ( { location : project } ) ; return query . exec ( ) . then ( function ( doc ) { return doc ? Promise . resolve ( doc ) : sharedProject . create ( { location : project , hubid : hub } ) ; } ) ; }
Adds the project and a new hubID to the sharedProjects db document.
Adds the project and a new hubID to the sharedProjects db document .