mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			511 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			511 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var path = require("path");
 | |
| var mongojs = require("mongojs");
 | |
| var db = require(pathThumbnails + "/handlers/db.js");
 | |
| 
 | |
| function update(collection, searchObject, updateObject, extraObject) {
 | |
|   return new Promise((resolve, reject) => {
 | |
|     db.collection(collection).update(
 | |
|       searchObject,
 | |
|       updateObject,
 | |
|       extraObject,
 | |
|       (error, result) => {
 | |
|         if (error) {
 | |
|           reject(error);
 | |
|           return;
 | |
|         }
 | |
|         resolve(result);
 | |
|       }
 | |
|     );
 | |
|   });
 | |
| }
 | |
| 
 | |
| module.exports.update = update;
 |