<commit_before>"use strict"
const FirebaseRef = Firebase;

Firebase = {};

class Collection {
  constructor(name, options){
    options = options || {};

    var endpoint = options.endpoint;

    if (!endpoint){
      throw new Meteor.Error('firebase-error', 'no endpoint specified');
    }

    this.ref = new FirebaseRef( UrlUtils.resolve(endpoint, name)  );
  }
};


Firebase.Collection = Collection;
// useful for debug
Firebase._FirebaseRef = FirebaseRef;<commit_msg>implemented insert method<commit_after>"use strict"
const FirebaseRef = Firebase;

Firebase = {};

class Collection {
  constructor(name, options){
    options = options || {};

    var endpoint = options.endpoint;

    if (!endpoint){
      throw new Meteor.Error('firebase-error', 'no endpoint specified');
    }

    this.ref = new FirebaseRef( UrlUtils.resolve(endpoint, name)  );
  }
  /**
   *@summary Insert a document into a collection. Returns its unique _id;
   */
  insert(doc){
    var newDocRef = this.ref.push(doc);
    return newDocRef.key();
  }
};


Firebase.Collection = Collection;
// useful for debug
Firebase._FirebaseRef = FirebaseRef;
{'fraction_non_alphanumeric': 0.1266607617360496, 'fraction_numerical': 0.0, 'mean_word_length': 3.6311475409836067, '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': '5977024', 'n_tokens_mistral': 345, 'n_tokens_neox': 333, 'n_words': 88}