Mongoose and MongoDB patterns — schema design, validation, indexes, virtuals,
99
99%
Does it follow best practices?
Impact
100%
1.11xAverage score across 5 eval scenarios
Passed
No known issues
maxPoolSize configured
100%
100%
serverSelectionTimeoutMS set
0%
100%
socketTimeoutMS set
0%
100%
URI from environment variable
100%
100%
error event handler
100%
100%
disconnected event handler
100%
100%
SIGTERM handler
100%
100%
SIGINT handler
100%
100%
connection.close on shutdown
100%
100%
await on connect
100%
100%
startSession called
100%
100%
withTransaction used
100%
100%
session passed to debit
100%
100%
session passed to credit
100%
100%
endSession in finally
100%
100%
no independent updates
100%
100%
timestamps on Wallet schema
100%
100%
required on wallet fields
100%
100%
balanceCents minimum
100%
100%
runValidators on updates
66%
100%
author data embedded
100%
100%
no populate for author
100%
100%
tags as references
100%
100%
cursor-based pagination
100%
100%
no skip usage
100%
100%
limit plus one fetch
100%
100%
nextCursor returned
100%
100%
lean on feed query
0%
100%
timestamps on Post
100%
100%
status enum on Post
100%
100%
lean on listProducts
100%
100%
no lean on updateProductPrice
100%
100%
runValidators on admin update
71%
100%
save() for price update
100%
100%
no direct update for price
100%
100%
pre-save hook defined
100%
100%
enum for status
100%
100%
required fields
100%
100%
timestamps option
100%
100%
stock minimum constraint
100%
100%
new: true on admin update
100%
100%
timestamps on Event
100%
100%
timestamps on Ticket
100%
100%
timestamps on Session
0%
100%
required fields on Event
100%
100%
required fields on Ticket
100%
100%
enum for ticket status
100%
100%
enum for event category
100%
100%
trim on string fields
100%
100%
compound index on Event
100%
100%
unique index for email
0%
100%
TTL index on Session
100%
100%
TTL value for 7 days
100%
100%