<commit_before>/**
 * Module Dependencies
 */
var async = require("async");
var Collection = require('sails-mongo/lib/collection');
var Query = require('sails-mongo/lib/query');
var ObjectId = require('sails-mongo/node_modules/mongodb').ObjectID;

/**
 * sails-mongo-tree
 *
 * Most of the methods below are optional.
 *
 * If you don't need / can't get to every method, just implement
 * what you have time for.  The other methods will only fail if
 * you try to call them!
 *
 */

var pathSeparator = '#'
var selfId = '$'

var __parseDefinition = Collection.prototype._parseDefinition
Collection.prototype._parseDefinition = function(definition) {

    if(definition.definition.parent)
        definition.definition.__path = { type: 'string', defaultsTo: selfId }

    __parseDefinition.call(this, definition)
}

function path(obj) {
    if(obj.__path && obj.__path.length > 0)
        return obj.__path.replace(selfId, obj._id ? obj._id : (obj.id ? obj.id : ''));
    return '';
}

var __insert = Collection.prototype.insert
Collection.prototype.insert = function(values, cb) {<commit_msg>Pulling ObjectId from mongodb module<commit_after>/**
 * Module Dependencies
 */
var async = require("async");
var Collection = require('sails-mongo/lib/collection');
var Query = require('sails-mongo/lib/query');
var ObjectId = require('mongodb').ObjectID;
/**
 * sails-mongo-tree
 *
 * Most of the methods below are optional.
 *
 * If you don't need / can't get to every method, just implement
 * what you have time for.  The other methods will only fail if
 * you try to call them!
 *
 */

var pathSeparator = '#'
var selfId = '$'

var __parseDefinition = Collection.prototype._parseDefinition
Collection.prototype._parseDefinition = function(definition) {

    if(definition.definition.parent)
        definition.definition.__path = { type: 'string', defaultsTo: selfId }

    __parseDefinition.call(this, definition)
}

function path(obj) {
    if(obj.__path && obj.__path.length > 0)
        return obj.__path.replace(selfId, obj._id ? obj._id : (obj.id ? obj.id : ''));
    return '';
}

var __insert = Collection.prototype.insert
Collection.prototype.insert = function(values, cb) {
{'fraction_non_alphanumeric': 0.13067400275103164, 'fraction_numerical': 0.0009170105456212746, 'mean_word_length': 3.9931350114416477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2587632', 'n_tokens_mistral': 655, 'n_tokens_neox': 638, 'n_words': 176}