|
@@ -0,0 +1,28 @@
|
|
1
|
+# -*- coding: utf-8 -*-
|
|
2
|
+import pymongo
|
|
3
|
+from pymongo import MongoClient
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+DEFAULT_CONNECTION = {
|
|
7
|
+ 'host': 'localhost',
|
|
8
|
+ 'port': 27017,
|
|
9
|
+ 'dbname': 'lodel'
|
|
10
|
+}
|
|
11
|
+
|
|
12
|
+class MongoDbDataSource(object):
|
|
13
|
+
|
|
14
|
+ def __init__(self, module=pymongo, connection_args=DEFAULT_CONNECTION):
|
|
15
|
+ self.connection = MongoClient(connection_args['host'], connection_args['port'])
|
|
16
|
+ self.database = self.connection[connection_args['dbname']]
|
|
17
|
+
|
|
18
|
+ def select(self):
|
|
19
|
+ pass
|
|
20
|
+
|
|
21
|
+ def delete(self):
|
|
22
|
+ pass
|
|
23
|
+
|
|
24
|
+ def update(self):
|
|
25
|
+ pass
|
|
26
|
+
|
|
27
|
+ def insert(self):
|
|
28
|
+ pass
|