Quick start improvement suggestions
ivansenic opened this issue · comments
Ivan Senic commented
I went through the Quick start and I have a few suggestions. I did not know how to suggest improvements better than opening a ticket.
Suggestions:
- All runnable scripts should have a
bash
orscript
notation so I can run them directly from the IDE. Found one issue here:Lines 19 to 22 in 5a27c8b
- I would prefer an option with
yarn
, rather thannpm
.. Or at least list both options, so people can chose.. - Type script must be default, it has become de-facto standard..
- Running the file with node v12 (which was by accident default), results in following, set the desired node version in the
npm init
and add toREADME.md
(v14 seems to work):
node index.js
/home/ise/workspace/open-source/mongoose-stargate-sample/node_modules/mongodb/lib/operations/add_user.js:16
this.options = options ?? {};
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/ise/workspace/open-source/mongoose-stargate-sample/node_modules/mongodb/lib/admin.js:4:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
- sample code is very hard to read, I would separate it into logical blocks (comment only before the block, not between the lines):
- imports
- driver override (very important)
- schema setup
- endpoint defintions and app running
- sample code should be formatted with
prittier
(currently not formatted at all)
Kathiresan Selvaraj commented
@ivansenic Thanks for opening a ticket with the feedback/suggestions, this will really help improving the 'Quick Start' experience. I'll work on these and will update.