$ docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # General | |
| alias mkdir='mkdir -pv' | |
| alias cp='cp -iv' | |
| alias mv='mv -iv' | |
| alias less='less -FSRXc' | |
| alias srcb='source ~/.bashrc' | |
| #alias rm='rm -v' | |
| gist_id=1669066880bd89489de27ed9a8b2e760 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Stage 1 (production base) | |
| # This gets our prod dependencies installed and out of the way | |
| FROM node:12.2 as base | |
| EXPOSE 5000 | |
| ENV NODE_ENV=production | |
| # Add Tini | |
| ENV TINI_VERSION v0.18.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2.4' | |
| services: | |
| db: | |
| image: mongo:4.0.10-xenial | |
| restart: always | |
| command: --wiredTigerCacheSizeGB 1 --auth --directoryperdb | |
| volumes: | |
| - dbData:/data/db | |
| environment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| mongo1: | |
| hostname: mongo1 | |
| container_name: localmongo1 | |
| image: mongo:4.0-xenial | |
| expose: | |
| - 27017 | |
| ports: | |
| - 27011:27017 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### https://github.com/tjworks/mongoscripts/tree/master/x509 ### | |
| # Prerequisites: | |
| # a. Make sure you have MongoDB Enterprise installed. | |
| # b. Make sure mongod/mongo are in the executable path | |
| # c. Make sure no mongod running on 27017 port, or change the port below | |
| # d. Run this script in a clean directory | |
| ##### Feel free to change following section values #### | |
| # Changing this to include: country, province, city, company | |
| dn_prefix="/C=CN/ST=GD/L=Shenzhen/O=MongoDB China" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .... | |
| export default { | |
| Query: { | |
| class: () => {...} | |
| }, | |
| classes: async (root, { conditions }, { dataSources, userId }, info) => { | |
| // Check for authentication | |
| ... | |
| const projection = gqlMongoDBProjection(info); | |
| return dataSources.Class.getAllClasses(conditions, projection); |
Whether or not one should embed nested docs or to use the reference by ID and populate later is a great question and has been answered nicely on StackOverflow