Postgres Window Functions Postgresql Vs Mongodb