Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 16 commits
  • 4 files changed
  • 0 commit comments
  • 3 contributors
Commits on Mar 12, 2012
@kriszyp Merge pull request #24 from kriszyp/master
Several fixes
0cd34b9
Commits on Apr 18, 2012
@kriszyp Merge pull request #25 from kriszyp/master
update paths
737e414
Commits on Apr 27, 2012
@kriszyp Merge pull request #26 from kriszyp/master
Fix subarray serialization
b9a3040
Commits on May 15, 2012
@neonstalwart neonstalwart put `now` in scope for the usage in `get` fe2a89f
@neonstalwart neonstalwart fix syntax error 26bd792
@neonstalwart neonstalwart remove unused var 051daba
@kriszyp Merge pull request #27 from neonstalwart/now
put `now` in scope for the usage in `get`
0108492
Commits on Jun 07, 2012
@neonstalwart neonstalwart remove what looks like an unnecessary (and incorrect) override of 're…
…' converter
6f9da77
Commits on Aug 22, 2012
@kriszyp Merge pull request #29 from kriszyp/master
mongodb object store adapter to handle saving binary content incoming from pintura
fb528bb
Commits on Aug 23, 2012
@neonstalwart neonstalwart add filename option for mongodb-file store 662c2c4
@neonstalwart neonstalwart Merge pull request #30 from neonstalwart/filename
add filename option for mongodb-file store
5f94664
Commits on Aug 31, 2012
@neonstalwart neonstalwart pass along directives to add when calling via post 2f28bdc
@kriszyp Merge pull request #32 from neonstalwart/post-directives
pass along directives to add when calling via post
40c8a51
Commits on Oct 01, 2012
@neonstalwart neonstalwart update mongodb store to return the id after `put` 834bf90
@kriszyp Merge pull request #35 from neonstalwart/mongo-ids
update mongodb store to return the id after `put`
16aa238
Commits on Mar 21, 2013
@kriszyp Merge git://github.com/persvr/perstore
Conflicts:
	store/mongodb-file.js
da2f40b
View
2  facet.js
@@ -273,7 +273,7 @@ function FacetedStore(store, facetSchema){
}
if(!directives.id){
// create a new object
- return this.add(props);
+ return this.add(props, directives);
}
else{
// check to see if it is an RPC object
View
10 store/cache.js
@@ -1,8 +1,7 @@
/**
* This is a wrapper store that can add caching to a store
*/
-var table = {},
- when = require("promised-io/promise").when;
+var when = require("promised-io/promise").when;
exports.Cache = function(store, cacheStore, options){
options = options || {};
@@ -11,9 +10,10 @@ exports.Cache = function(store, cacheStore, options){
var cleanupInterval = options.cleanupInterval || 1000;
var lastAccess = {};
var nextCheck = new Date().getTime();
+ var now;
cleanup();
function cleanup(){
- var now = new Date().getTime();
+ now = new Date().getTime();
if(now > nextCheck){
nextCheck = now + cleanupInterval;
return when(cacheStore.query("expires<$1", {parameters:[now]}), function(results){
@@ -29,7 +29,7 @@ exports.Cache = function(store, cacheStore, options){
lastAccess[id] = now++;
if(!cached){
if(store){
- cacheStore.put(cached = store.get[id], {id:id});
+ cacheStore.put(cached = store.get(id), {id:id});
}
}
return cached;
@@ -71,4 +71,4 @@ exports.Cache = function(store, cacheStore, options){
cacheStore["delete"](id);
}
};
-};
+};
View
6 store/mongodb-file.js
@@ -17,10 +17,14 @@ module.exports = function(options){
each(contents.buffer);
};
object["content-type"] = object.type;
+ var disposition = 'attachment';
+ if (object.filename) {
+ disposition += ';filename="' + object.filename + '"';
+ }
var metadata = {
"content-type": object.type,
"content-length": contents.buffer.length,
- "content-disposition": 'attachment',
+ "content-disposition": disposition,
"filename": object.filename
};
metadata.alternates = [object];
View
10 store/mongodb.js
@@ -24,10 +24,6 @@ var convertNodeAsyncFunction = require('promised-io/promise').convertNodeAsyncFu
var RQ = require("rql/parser");
//RQ.converters["default"] = exports.converters.auto;
-RQ.converters['re'] = function(x){
-dir('RECONV:', x);
- return new RegExp(x, 'i');
-};
// candidate for commonjs-utils?
function dir(){var sys=require('sys');for(var i=0,l=arguments.length;i<l;i++)sys.debug(sys.inspect(arguments[i]));}
@@ -279,7 +275,7 @@ module.exports = function(options){
// .insert() returns array, we need the first element
obj = obj && obj[0];
if (obj) delete obj._id;
- deferred.resolve(obj);
+ deferred.resolve(obj.id);
});
} else {
deferred.reject(id + " exists, and can't be overwritten");
@@ -289,7 +285,7 @@ module.exports = function(options){
collection.update(search, object, {upsert: directives.overwrite}, function(err, obj){
if (err) return deferred.reject(err);
if (obj) delete obj._id;
- deferred.resolve(obj);
+ deferred.resolve(id);
});
}
return deferred;
@@ -384,4 +380,4 @@ module.exports = function(options){
}
}
}
-module.exports.MongoDB = module.exports;
+module.exports.MongoDB = module.exports;

No commit comments for this range

Something went wrong with that request. Please try again.