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: | |
| postgres-compose: | |
| image: postgres | |
| container_name: postgres | |
| environment: | |
| POSTGRES_USER: "root" | |
| POSTGRES_PASSWORD: "root" | |
| ports: |
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
| docker run -d \ | |
| --name=mariadb \ | |
| --restart=always \ | |
| -v /etc/localtime:/etc/localtime:ro \ | |
| -e MYSQL_ROOT_PASSWORD=senha \ | |
| -v /storage/mariadb:/var/lib/mysql \ | |
| mariadb:latest | |
| docker run -d \ | |
| --restart=always \ |
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
| 1° step | |
| Enter the project directory and run this command | |
| yarn add bootstrap jquery popper.js | |
| 2° step | |
| Add this code inside the file config/webpack/environment.js | |
| const { environment } = require('@rails/webpacker') | |
| const webpack = require('webpack') |
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: | |
| mongo-express: | |
| image: mongo-express | |
| container_name: mongoexpress | |
| ports: | |
| - 8081:8081 | |
| environment: | |
| ME_CONFIG_BASICAUTH_USERNAME: mongoadmin |
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
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |