Commit graph

7 commits

Author SHA1 Message Date
Jakob Ackermann
918cd0bfbe [misc] mongodb: use the new db connector by default
mongojs was enabling it by default as well.
2020-09-10 10:09:30 +01:00
Jakob Ackermann
f6083a2d51 [misc] mongodb: refactor the process of setting up the db construct
Co-Authored-By: John Lees-Miller <jdleesmiller@gmail.com>
2020-09-10 10:08:30 +01:00
Jakob Ackermann
0cf5cad3b8 [misc] mongodb: drop the getCollection helper 2020-09-10 10:08:30 +01:00
Jakob Ackermann
4080784310 [misc] simplify mongodb collection access using a shared db construct
Resolve the getCollection Promises once and store the result in a shared
 `db` object which can get imported by all the call-sites.

The http server is starting only after a Promise of `waitForDb()`
 resolves. This covers the app code and the acceptance tests:
REF: 586706a9439c3591fc9613dc877f055096ca073a
REF: d026569d2eb4123e30c771a55a001b42d5ade72f
2020-09-10 10:08:30 +01:00
Jakob Ackermann
a52c0fe9fb [misc] mongodb: drop intermediate dbPromise
It would confuse the logic of a follow-up commit.
2020-09-10 10:08:23 +01:00
Jakob Ackermann
39ea30355e [misc] simplify the naming around waiting for a mongo connection
Co-Authored-By: Eric Mc Sween <eric.mcsween@overleaf.com>
Co-Authored-By: Miguel Serrano <mserranom@gmail.com>
Co-Authored-By: Simon Detheridge <s@sd.ai>
2020-08-24 17:41:03 +01:00
Jakob Ackermann
0c8f04a011 [misc] migrate to native mongo driver 2020-08-19 13:04:47 +01:00