<commit_before>import mongoose from 'mongoose';

import Model from '../model';

const ObjectIdSchema = mongoose.Schema.ObjectId;
const ObjectId = mongoose.Types.ObjectId;


const UserSchema = new mongoose.Schema({
    date: {type: String, default: ''},
    username: {type: String, default: ''},
    telegramId: {type: String, default: ''},
    chatId: {type: String, default: ''},
    answers: [{
        answerId: {type: String, default: ''},
        question: {type: String, default: ''},
        questionId: {type: String, default: ''},
        answer: {type: String, default: ''}
    }]
});

const UserBOSchema = new mongoose.Schema({
    email: {type: String, required : true},
    password: {type: String, required : true},
    accessToken: {type: String},
});

UserSchema.set('toJSON', {
    transform: function (doc, ret) {
        delete ret._id;
        delete ret.__v;
    },
});

UserBOSchema.set('toJSON', {
    transform: function (doc, ret) {
        delete ret._id;
        delete ret.__v;
    },
});

const User = mongoose.model('User', UserSchema);
const UserBO = mongoose.model('UserBO', UserBOSchema);

/**
 * Service level class with methods for user.
 */
export default class UserModel {
    constructor() {
        this.model = new Model(User);
        this.modelBO = new Model(UserBO);
    }
    
    getUserBO(criteria) {
    	console.log(criteria);
        return this.modelBO.select(criteria, {limit: 1});
    }<commit_msg>deploying<commit_after>import mongoose from 'mongoose';

import Model from '../model';

const ObjectIdSchema = mongoose.Schema.ObjectId;
const ObjectId = mongoose.Types.ObjectId;


const UserSchema = new mongoose.Schema({
    date: {type: String, default: ''},
    username: {type: String, default: ''},
    telegramId: {type: String, default: ''},
    chatId: {type: String, default: ''},
    answers: [{
        answerId: {type: String, default: ''},
        question: {type: String, default: ''},
        questionId: {type: String, default: ''},
        answer: {type: String, default: ''}
    }]
});

const UserBOSchema = new mongoose.Schema({
    email: {type: String, required : true},
    password: {type: String, required : true},
    accessToken: {type: String},
});

UserSchema.set('toJSON', {
    transform: function (doc, ret) {
        delete ret._id;
        delete ret.__v;
    },
});

UserBOSchema.set('toJSON', {
    transform: function (doc, ret) {
        delete ret._id;
        delete ret.__v;
    },
});

const User = mongoose.model('User', UserSchema);
const UserBO = mongoose.model('UserBO', UserBOSchema);

/**
 * Service level class with methods for user.
 */
export default class UserModel {
    constructor() {
        this.model = new Model(User);
        this.modelBO = new Model(UserBO);
    }
    
    getUserBO(criteria) {
        return this.modelBO.select(criteria, {limit: 1});
    }
{'fraction_non_alphanumeric': 0.15470383275261324, 'fraction_numerical': 0.0006968641114982578, 'mean_word_length': 3.055084745762712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4790180', 'n_tokens_mistral': 897, 'n_tokens_neox': 912, 'n_words': 235}