<commit_before>import * as mongoose from "mongoose";
import BookRepo, { Book } from "./test/models/Book";
import UserRepo, { User } from "./test/models/User";

const init = async () => {
    console.log("connecting..");
    (mongoose as any).Promise = global.Promise;
    const connectionResponse = await mongoose.connect("mongodb://localhost/typemongoose");
    console.log("connected.");

    const allUsers = await UserRepo.query.find({});
    console.log(allUsers);

    const book = await BookRepo.query.findOne().populate("user");
    const user = book.user as User;
    console.log(user.getName());
};

init();<commit_msg>Expose library<commit_after>import * as BaseModel from "./BaseModel";
import * as Decorators from "./Decorators";
import * as ModelRepo from "./ModelRepo";

export {
    BaseModel,
    Decorators,
    ModelRepo
};
{'fraction_non_alphanumeric': 0.15320665083135393, 'fraction_numerical': 0.0, 'mean_word_length': 3.958823529411765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4957815', 'n_tokens_mistral': 252, 'n_tokens_neox': 259, 'n_words': 63}