Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 142 lines (134 sloc) 6.274 kB
d0577d5 @bububa first commit
authored
1 //
2 // Mongo.h
3 // MongoHub
4 //
5 // Created by Syd on 10-4-25.
6 // Copyright 2010 MusicPeace.ORG. All rights reserved.
7 //
8
9 #import <Cocoa/Cocoa.h>
10 #import <mongo/client/dbclient.h>
11
12 @interface MongoDB : NSObject {
13 mongo::DBClientConnection *conn;
d67d476 @bububa Add replica set connection support.
authored
14 mongo::DBClientReplicaSet::DBClientReplicaSet *repl_conn;
15 BOOL isRepl;
d0577d5 @bububa first commit
authored
16 }
0bb2845 @bububa support import from mysql and export to mysql
authored
17 - (mongo::DBClientConnection *)mongoConnection;
d67d476 @bububa Add replica set connection support.
authored
18 - (mongo::DBClientReplicaSet::DBClientReplicaSet *)mongoReplConnection;
d0577d5 @bububa first commit
authored
19
20 - (id)initWithConn:(NSString *)host;
d67d476 @bububa Add replica set connection support.
authored
21 - (id)initWithConn:(NSString *)name
22 hosts:(NSArray *)hosts;
d0577d5 @bububa first commit
authored
23 - (bool)connect:(NSString *)host;
d67d476 @bububa Add replica set connection support.
authored
24 - (bool)connect:(NSString *)name
25 hosts:(NSArray *)hosts;
26 - (bool)authUser:(NSString *)user
15398e7 @bububa fixed bugs in Array and NumberLong elements
authored
27 pass:(NSString *)pass
28 database:(NSString *)db;
d0577d5 @bububa first commit
authored
29 - (NSArray *)listDatabases;
30 - (NSArray *)listCollections:(NSString *)db
31 user:(NSString *)user
32 password:(NSString *)password;
33 - (NSMutableArray *) serverStatus;
34 - (NSMutableArray *) dbStats:(NSString *)dbname
35 user:(NSString *)user
36 password:(NSString *)password;
37 - (void) dropDB:(NSString *)dbname
38 user:(NSString *)user
39 password:(NSString *)password;
40 - (NSMutableArray *) collStats:(NSString *)collectionname
41 forDB:(NSString *)dbname
42 user:(NSString *)user
43 password:(NSString *)password;
44 - (void) createCollection:(NSString *)collectionname
45 forDB:(NSString *)dbname
46 user:(NSString *)user
47 password:(NSString *)password;
48 - (void) dropCollection:(NSString *)collectionname
49 forDB:(NSString *)dbname
50 user:(NSString *)user
51 password:(NSString *)password;
52 - (NSMutableArray *) findInDB:(NSString *)dbname
53 collection:(NSString *)collectionname
54 user:(NSString *)user
55 password:(NSString *)password
56 critical:(NSString *)critical
57 fields:(NSString *)fields
58 skip:(NSNumber *)skip
59 limit:(NSNumber *)limit
60 sort:(NSString *)sort;
a360773 @bububa fixed several crash bugs;
authored
61 - (void) saveInDB:(NSString *)dbname
62 collection:(NSString *)collectionname
63 user:(NSString *)user
64 password:(NSString *)password
65 jsonString:(NSString *)jsonString
66 _id:(NSString *)_id;
d0577d5 @bububa first commit
authored
67 - (void) updateInDB:(NSString *)dbname
68 collection:(NSString *)collectionname
69 user:(NSString *)user
70 password:(NSString *)password
71 critical:(NSString *)critical
72 fields:(NSString *)fields
73 upset:(NSNumber *)upset;
74 - (void) removeInDB:(NSString *)dbname
75 collection:(NSString *)collectionname
76 user:(NSString *)user
77 password:(NSString *)password
78 critical:(NSString *)critical;
79 - (void) insertInDB:(NSString *)dbname
80 collection:(NSString *)collectionname
81 user:(NSString *)user
82 password:(NSString *)password
83 insertData:(NSString *)insertData;
0bb2845 @bububa support import from mysql and export to mysql
authored
84 - (void) insertInDB:(NSString *)dbname
85 collection:(NSString *)collectionname
86 user:(NSString *)user
87 password:(NSString *)password
88 data:(NSDictionary *)insertData
89 fields:(NSArray *)fields
90 fieldTypes:(NSDictionary *)fieldTypes;
d0577d5 @bububa first commit
authored
91 - (NSMutableArray *) indexInDB:(NSString *)dbname
92 collection:(NSString *)collectionname
93 user:(NSString *)user
94 password:(NSString *)password;
95 - (void) ensureIndexInDB:(NSString *)dbname
96 collection:(NSString *)collectionname
97 user:(NSString *)user
98 password:(NSString *)password
99 indexData:(NSString *)indexData;
100 - (void) reIndexInDB:(NSString *)dbname
101 collection:(NSString *)collectionname
102 user:(NSString *)user
103 password:(NSString *)password;
104 - (void) dropIndexInDB:(NSString *)dbname
105 collection:(NSString *)collectionname
106 user:(NSString *)user
107 password:(NSString *)password
108 indexName:(NSString *)indexName;
0bb2845 @bububa support import from mysql and export to mysql
authored
109 - (long long int) countInDB:(NSString *)dbname
d0577d5 @bububa first commit
authored
110 collection:(NSString *)collectionname
111 user:(NSString *)user
112 password:(NSString *)password
113 critical:(NSString *)critical;
ba9835d @bububa add mapreduce function support
authored
114 - (NSMutableArray *)mapReduceInDB:dbname
115 collection:collectionname
116 user:user
117 password:password
118 mapJs:mapFunction
119 reduceJs:reduceFunction
120 critical:critical
121 output:output;
d0577d5 @bububa first commit
authored
122 - (NSMutableArray *) bsonDictWrapper:(mongo::BSONObj)retval;
123 - (NSMutableArray *) bsonArrayWrapper:(mongo::BSONObj)retval;
0bb2845 @bububa support import from mysql and export to mysql
authored
124
125 - (std::auto_ptr<mongo::DBClientCursor>) findAllCursorInDB:(NSString *)dbname collection:(NSString *)collectionname user:(NSString *)user password:(NSString *)password fields:(mongo::BSONObj) fields;
126
8d53647 @bububa Fixed a bug related to Date Object in JSONEditor
authored
127 - (std::auto_ptr<mongo::DBClientCursor>) findCursorInDB:(NSString *)dbname collection:(NSString *)collectionname user:(NSString *)user password:(NSString *)password critical:(NSString *)critical fields:(NSString *)fields skip:(NSNumber *)skip limit:(NSNumber *)limit sort:(NSString *)sort;
128
129 - (void) updateBSONInDB:(NSString *)dbname
130 collection:(NSString *)collectionname
131 user:(NSString *)user
132 password:(NSString *)password
133 critical:(mongo::Query)critical
134 fields:(mongo::BSONObj)fields
135 upset:(bool)upset;
136
f0632b4 @bububa Add mongo stat monitor
authored
137 - (mongo::BSONObj) serverStat;
2aaf0b0 @bububa more accurate mongo stat time interval
authored
138 - (NSDictionary *) serverMonitor:(mongo::BSONObj)a second:(mongo::BSONObj)b currentDate:(NSDate *)now previousDate:(NSDate *)previous;
139 - (double) diff:(NSString *)aName first:(mongo::BSONObj)a second:(mongo::BSONObj)b timeInterval:(NSTimeInterval)interval;
f0632b4 @bububa Add mongo stat monitor
authored
140 - (double) percent:(NSString *)aOut value:(NSString *)aVal first:(mongo::BSONObj)a second:(mongo::BSONObj)b;
d0577d5 @bububa first commit
authored
141 @end
Something went wrong with that request. Please try again.