This file contains 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
db.teams.insert( | |
[ | |
{ | |
"_id": ObjectId("5d0c18c190d2b33ae629aaa7"), | |
"name": "HingleMcCringleberry", | |
"players": [ | |
{"name": "Nick Chubb", "score": 0}, | |
{"name": "James Conner", "score": 0}, | |
{"name": "Julio Jones", "score": 0}, | |
{"name": "Michael Thomas", "score": 0} |
This file contains 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
import lombok.AllArgsConstructor; | |
import lombok.Builder; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
import org.bson.types.ObjectId; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
import org.springframework.data.mongodb.core.mapping.Field; | |
import java.util.ArrayList; |
This file contains 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
import lombok.AllArgsConstructor; | |
import lombok.Builder; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
@Data | |
@Builder | |
@AllArgsConstructor | |
@NoArgsConstructor |
This file contains 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
# this assumes that your docker-compose.yml file is located in ./docker | |
up-db-local: rebuild-mongo | |
pushd docker &&\ | |
docker-compose up -d mongo &&\ | |
popd | |
rebuild-mongo: | |
pushd docker &&\ | |
docker-compose build mongo-seed &&\ | |
docker-compose up mongo-seed &&\ |
This file contains 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
FROM mongo:4.0 | |
COPY init.js /init.js |
This file contains 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
com.mongodb.MongoCommandException: | |
Command failed with error 40573 (Location40573): | |
'The $changeStream stage is only supported on replica sets' on server localhost:27017. | |
The full response is: | |
{ | |
"ok" : 0.0, | |
"errmsg" : "The $changeStream stage is only supported on replica sets", | |
"code" : 40573, | |
"codeName" : "Location40573" | |
} |
This file contains 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
FROM mongo:4.0 | |
# files used to initialize the database | |
COPY ./init-db.d/ /docker-entrypoint-initdb.d | |
# add this command to a js file in the init directory | |
# formatted on newlines for better readability | |
RUN echo "rs.initiate( | |
{ | |
_id: 'rs0', |
This file contains 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
FROM mongo:4.0 | |
# files used to initialize the database | |
COPY ./init-db.d/ /docker-entrypoint-initdb.d |
This file contains 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
#!/usr/bin/env bash | |
echo "Running docker cleanup script" | |
echo "Stopping all containers" | |
docker stop $(docker ps -a -q) # Stop all containers | |
echo "Removing stopped containers" | |
docker rm $(docker ps -a -q) # Remove all stopped containers |
This file contains 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
import {NgModule} from '@angular/core'; | |
import {MyLibComponent} from './my-lib.component'; | |
import {NavigationModule} from "./navigation/navigation.module"; // <-- lengthened | |
import {FormModule} from "./form/form.module"; // <-- lengthened | |
@NgModule({ | |
declarations: [MyLibComponent], | |
imports: [NavigationModule, FormModule], | |
exports: [NavigationModule, FormModule] | |
}) |