2023-10-03 01:19:36 -04:00
|
|
|
import mongoose from "mongoose";
|
|
|
|
import { Story } from "~/models/stories";
|
|
|
|
|
|
|
|
export default eventHandler(async (event) => {
|
|
|
|
let aa = mongoose.connection.db.collection("z_index_totAuthors");
|
|
|
|
let totalStories = await Story.countDocuments({ "chapters.hidden": false });
|
|
|
|
let totalAuthors = await aa.countDocuments();
|
|
|
|
|
|
|
|
return { stories: totalStories, authors: totalAuthors };
|
|
|
|
});
|