stargate / stargate-mongoose

Mongoose Node.js package for Apache Cassandra / DataStax Astra

Home Page:https://stargate.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick start improvement suggestions

ivansenic opened this issue · comments

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 or script notation so I can run them directly from the IDE. Found one issue here:
    ```git
    git clone https://github.com/stargate/stargate-mongoose.git
    cd stargate-mongoose
    ```
  • I would prefer an option with yarn, rather than npm.. 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 to README.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):
    1. imports
    2. driver override (very important)
    3. schema setup
    4. endpoint defintions and app running
  • sample code should be formatted with prittier (currently not formatted at all)

@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.