gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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
exports.deleteUser = async (req, res, next) { | |
const session = await mongoose.startSession(); | |
try { | |
const { id } = req.params; | |
// Start session | |
await session.startTransaction(); | |
// deleteMany in this session | |
const [errorOp, result] = await toAll([App.deleteMany({ user: id }).session(session), UserModel.findByIdAndRemove(id).session(session)]); | |
if (errorOp) { | |
throw new ErrorRequest(STATUS_CODE.UNPROCESSABLE, errorOp.message); |
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
exports.deleteUser = async (req, res, next) { | |
const session = await mongoose.startSession(); | |
try { | |
const { id } = req.params; | |
// Start session | |
await session.startTransaction(); | |
// deleteMany in this session | |
const [errorOp, result] = await toAll([App.deleteMany({ user: id }).session(session), UserModel.findByIdAndRemove(id).session(session)]); | |
if (errorOp) { | |
throw new ErrorRequest(STATUS_CODE.UNPROCESSABLE, errorOp.message); |
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
Ejecutarlo en el terminal. | |
compton --config /dev/null |
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
# crea el indice para buscar texto en el campo. | |
db.getCollection('mi_collection').createIndex( { "CAMPO": "text" } ) | |
# busca un texto en el campo de el indice creado | |
db.getCollection('mi_collection').find( { $text: { $search: "MI NOMBRE ES" } } ) | |
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
#Creamos los directorios. | |
C:\mongodb\db | |
C:\mongodb\config | |
C:\mongodb\log | |
##IMPORTANTE | |
#Al crear los archivos mongo.log y mongod.cfg, asegurarse de que no tenga el .txt al final. | |
#Asi no les va a funcionar, mongo.log.txt, mongod.cfg.txt | |
#Asi es la forma correcta mongo.log, mongod.cfg |