<commit_before>import dbs from './dbs'

export default {
  async get({equipment}){
    const {session} = dbs.mongoDB;

    let obj = await session.findOne('session', {
      _id: equipment.__ID__
    });
    if (!obj) {
      obj = await session.insert('session', {
        _id: equipment.__ID__
      })
    }
    return obj;
  },
  async bindUser(){

  },
  async set({equipment}, data){
    const {session} = dbs.mongoDB;
    let obj = await session.findOne('session', {
      _id: equipment.__ID__
    });
    if (obj) {
      await session.update('session', {
          _id: equipment.__ID__
        }, {
          '$set': data
        }
      );
    } else {
      obj = await session.insert('session', {
        _id: equipment.__ID__,
        data
      })<commit_msg>修改init的错误<commit_after>import dbs from './dbs'
const {session} = dbs.mongoDB;

export default {
  async get({equipment}){
    let obj = await session.findOne('session', {
      _id: equipment.__ID__
    });
    if (!obj) {
      obj = await session.insert('session', {
        _id: equipment.__ID__
      })
    }
    return obj;
  },
  async bindUser(){

  },
  async set({equipment}, data){
    let obj = await session.findOne('session', {
      _id: equipment.__ID__
    });
    if (obj) {
      await session.update('session', {
          _id: equipment.__ID__
        }, {
          '$set': data
        }
      );
    } else {
      obj = await session.insert('session', {
        _id: equipment.__ID__,
        data
      })
{'fraction_non_alphanumeric': 0.1454183266932271, 'fraction_numerical': 0.0, 'mean_word_length': 1.9723865877712032, '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': '6921218', 'n_tokens_mistral': 488, 'n_tokens_neox': 485, 'n_words': 107}