feat: use user id instead of username to refer to users

This commit is contained in:
tdurieux
2021-09-06 10:03:10 +02:00
parent 3fbf00c37b
commit e27493dc12
6 changed files with 25 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ const AnonymizedRepositorySchema = new Schema({
lastView: Date,
pageView: Number,
accessToken: String,
owner: String,
owner: mongoose.Schema.Types.ObjectId,
conference: String,
source: {
type: { type: String },

View File

@@ -12,7 +12,7 @@ export async function connect() {
mongoose.set("useFindAndModify", true);
mongoose.set("useUnifiedTopology", true);
await mongoose.connect(MONGO_URL + "test", {
await mongoose.connect(MONGO_URL + "production", {
authSource: "admin",
useCreateIndex: true,
useFindAndModify: true,