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
# mongod_dba_deploy_replica_set_auth_on_2.conf | |
# for documentation of all options, see: | |
# http://docs.mongodb.org/manual/reference/configuration-options/ | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb/2/db | |
journal: | |
enabled: true |
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
# mongod_dba_deploy_replica_set_auth_on_1.conf | |
# for documentation of all options, see: | |
# http://docs.mongodb.org/manual/reference/configuration-options/ | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb/1/db | |
journal: | |
enabled: true |
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
# mongod_dba_reconfig_replica_3.conf | |
# for documentation of all options, see: | |
# http://docs.mongodb.org/manual/reference/configuration-options/ | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb/3/db | |
journal: | |
enabled: true |
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
# mongod_dba_reconfig_replica_2.conf | |
# for documentation of all options, see: | |
# http://docs.mongodb.org/manual/reference/configuration-options/ | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb/2/db | |
journal: | |
enabled: true |
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
# mongod_m103_reconfig_replica_1.conf | |
# for documentation of all options, see: | |
# http://docs.mongodb.org/manual/reference/configuration-options/ | |
# Where and how to store data. | |
storage: | |
dbPath: /var/lib/mongodb/1/db | |
journal: | |
enabled: true |
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
set -euxo pipefail | |
echo "Running track setup script" | |
until [ -f /opt/instruqt/bootstrap/host-bootstrap-completed ]; do | |
echo "Waiting for instruqt bootstrap to complete" | |
sleep 1 | |
done | |
# check if temp dir exists | |
if [ ! -d /tmp ]; then |
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
rs.conf() | |
config = rs.config() | |
config.members[2].priority = 10 | |
rs.reconfig(config) | |
rs.status() |
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
const mongoose = require('mongoose'); | |
main().catch(err => console.log(err)); | |
async function main() { | |
await mongoose.connect(<Atlasconnection-string>); | |
const userSchema = new mongoose.Schema({ | |
name: { | |
type: String, |
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.zips.find( | |
{ state: "NY", pop: { $gte: 1000, $lte: 5000 }}, | |
{_id: 0, state: 1, city: 1, pop: 1} | |
).sort({pop: -1}) | |
.limit(10) |
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.transfers.aggregate( [ | |
{ | |
$lookup: | |
{ | |
from: "accounts", | |
localField: "transfer_id", | |
foreignField: "transfers_complete", | |
pipeline: [ | |
{ $project: { _id: 0, account_id: 1, account_holder: 1 } } |