DEPTH of javascript recursive function
<p>I'm trying to save a json structure in mongodb, but I'd like to get the depth of recursiveness (<code>DEPTH</code>) that each item has when looping through this function. How can I achieve this reusing the following function?:</p>

<pre><code>_.mixin({
    importJsonItemsToMongo: function (obj, opt, iterator) {
        function recurse (json_item) {
            // console.log(`level ${DEPTH}: ${json_item.name}`);
            db.collection('json_import_items').insert(json_item);
            _.each(json_item.child_items, _.importJsonItemsToMongo);
        };
        recurse(obj);
    }
});
_.each(jsonResponse.child_items, _.importJsonItemsToMongo);
</code></pre>