forked from Tachone/zhihu_spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongodbs.py
27 lines (23 loc) · 903 Bytes
/
mongodbs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import mongoengine
#连接mongodb数据库,创建my_zhihu_data
mongoengine.connect('my_zhihu_data')
class Zhihu_User_Profile(mongoengine.Document):
user_name = mongoengine.StringField()
user_be_agreed = mongoengine.StringField()
user_be_thanked = mongoengine.StringField()
user_followees = mongoengine.StringField()
user_followers = mongoengine.StringField()
user_education_school = mongoengine.StringField()
user_education_subject = mongoengine.StringField()
user_employment = mongoengine.StringField()
user_employment_extra = mongoengine.StringField()
user_location = mongoengine.StringField()
user_gender = mongoengine.StringField()
user_info = mongoengine.StringField()
user_intro = mongoengine.StringField()
user_url = mongoengine.StringField()