Permalink
Browse files

simple connect method for local MongoDB databases.

  • Loading branch information...
1 parent 4eeb661 commit af6dfc4d640e7495a5c77a283445869b42bfebf7 Tim Burks committed Oct 10, 2010
Showing with 6 additions and 0 deletions.
  1. +2 −0 objc/NuMongoDB.h
  2. +4 −0 objc/NuMongoDB.m
View
@@ -61,6 +61,8 @@ limitations under the License.
/*! Connect to a MongoDB database. Options can include @"host" and @"port". */
- (int) connectWithOptions:(NSDictionary *) options;
+/*! Connect to a local MongoDB database on the default port (27017). */
+- (int) connect;
/*! Add user to named database. */
- (void) addUser:(NSString *) user withPassword:(NSString *) password forDatabase:(NSString *) database;
/*! Authenticate to named database. */
View
@@ -92,6 +92,10 @@ - (int) connectWithOptions:(NSDictionary *) options
return mongo_connect(conn, &opts);
}
+- (int) connect {
+ return [self connectWithOptions:nil];
+}
+
- (void) addUser:(NSString *) user withPassword:(NSString *) password forDatabase:(NSString *) database
{
mongo_cmd_add_user(conn, [database cStringUsingEncoding:NSUTF8StringEncoding],

0 comments on commit af6dfc4

Please sign in to comment.