Is it possible to see a list of users and chat histories in mongo? #278
-
Is it possible to see a list of users and chat histories in mongo? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
No, unless you look directly at the database. Look into mongo express |
Beta Was this translation helpful? Give feedback.
-
Hi @danny-avila now is possible to see how many users are using the librechat now by logs or mangodb? because we are using the 0.75, i saw the last answer from 2023-05-17. Thank you |
Beta Was this translation helpful? Give feedback.
-
Adding to this discussion as it came up quickly in my research. Instead of running (and exposing) express, you can get the users by using
and then added the #!/bin/bash
MONGO_CONNECTION_STRING="mongodb://mongodb:27017/LibreChat"
# --- MongoDB Command ---
# This is a JavaScript command executed within mongosh.
MONGO_COMMAND="
db.users.find().pretty();
"
mongosh --quiet "$MONGO_CONNECTION_STRING" --eval "$MONGO_COMMAND"
# --- Check for errors ---
if [ $? -eq 0 ]; then
echo "MongoDB command executed successfully."
else
echo "Error executing MongoDB command."
exit 1
fi It can then be run with |
Beta Was this translation helpful? Give feedback.
Adding to this discussion as it came up quickly in my research.
Apologies if it's rude to post to old threads in this repo.
Instead of running (and exposing) express, you can get the users by using
mongosh
I run docker-compose so I added this:
and then added the
list_users.sh script to
./mongosh/scripts/`