diff options
-rw-r--r-- | db/dbcommands.cpp | 5 | ||||
-rw-r--r-- | util/goodies.h | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index b0a7cdd6273..179e5bbf774 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -1291,7 +1291,6 @@ namespace mongo { virtual bool slaveOk() { return false; } - virtual LockType locktype() { return WRITE; } virtual bool requiresAuth() { return true; } @@ -1300,8 +1299,8 @@ namespace mongo { } virtual bool run(const char *dbname, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool) { string coll = cmdObj[ "godinsert" ].valuestrsafe(); - uassert( 13049, "godinsert must specify a collection", !coll.empty() ); - string ns = nsToDatabase( dbname ) + "." + coll; + uassert( "godinsert must specify a collection", !coll.empty() ); + string ns = nsToClient( dbname ) + "." + coll; BSONObj obj = cmdObj[ "obj" ].embeddedObjectUserCheck(); DiskLoc loc = theDataFileMgr.insert( ns.c_str(), obj, true ); return true; diff --git a/util/goodies.h b/util/goodies.h index f366107a4e3..88807c81754 100644 --- a/util/goodies.h +++ b/util/goodies.h @@ -242,6 +242,15 @@ namespace mongo { return (xt.sec & 0xfffff) * 1000 + t; } + struct Date_t { + // TODO: make signed (and look for related TODO's) + unsigned long long millis; + Date_t(): millis(0) {} + Date_t(unsigned long long m): millis(m) {} + operator unsigned long long&() { return millis; } + operator const unsigned long long&() const { return millis; } + }; + inline unsigned long long jsTime() { boost::xtime xt; boost::xtime_get(&xt, boost::TIME_UTC); |