0

我想用 PyMongo 做一个模型。下面是一个使用 MongoAlchemy 的模型。我怎样才能把它翻译成 PyMongo?

from blue import app
from flask_mongoalchemy import MongoAlchemy
app.config['MONGOALCHEMY_DATABASE'] = 'mydata'
app.config['MONGOALCHEMY_CONNECTION_STRING'] = "mongodb://localhost:27017/mydata"

db = MongoAlchemy(app)

class User1(db.Document):


    IBU_NAME = db.StringField()
    Project_ID = db.StringField()
    Type_of_Jobs = db.StringField()
    No_of_resource_requried_for_same_role = db.StringField()
    Spoc_Name = db.StringField()
    Spoc_Work_or_Direct_No = db.StringField()
    SPOC_Email = db.StringField()
    date_posted = db.StringField()
    City = db.StringField()
    Work_Experience = db.StringField()
    Type_of_request = db.StringField()
    Key_skills_or_responsibilities_requried_for_this_job_role = db.StringField()
    Copy_from_an_existing_jobs = db.StringField()
    State = db.StringField()
    Job_Role_or_Designation = db.StringField()
    Spoc_EMP_ID = db.StringField()
    Country = db.StringField()
    Spoc_Mobile_No = db.StringField()
4

0 回答 0