Many a times developer do ask a common question that, we need to change existing data bearing field's data type to another data type with out hampering existing data. Such as example, in database date field was in string value, but need to convert it in ISODate() format. Before going to nitty gritty details of … Continue reading MongoDB change or update field type
Month: November 2020
3. Shell comparison operator & reference
CommandDescriptionExample&Run the previous command in the backgroundls &&&Logical ANDif [ "$X" -ge "0" ] && [ "$X" -le "9"]||Logical ORif [ "$X" -lt "0" ] || [ "$X" -gt "9" ]^Start of linegrep "^X"$End of linegrep "X$"=String equality (cf. -eq)if [ "$X" = "bar" ]!Logical NOTif [ "$X" != "bar" ]$$PID (Process ID)of current shellecho … Continue reading 3. Shell comparison operator & reference
2. Shell script loop & conditional statement
Like other programming languages, shell script also have same loop concept, let us look at different types of loop syntax how it will work in shell scripts. For loop #!/bin/sh for x in hi 1 * 2 A bye do echo "display ... x is set to $x" done -----------------Display--------------- display ... i is set … Continue reading 2. Shell script loop & conditional statement
Run Shell script in Windows 10
Yes we can use Woindows 10 for execution of bash script. You need to change following things to make it enabled. Go to windows10 settings > Update & Security 1) Got to For Developers and choose Developer Mode2) In search bar Search for Windows Features. Click Turn Windows feature on and off Check windows sub … Continue reading Run Shell script in Windows 10
1. Shell script comment variable and wildcard
As we probably all know, shell script is badly required, when you thought to automate something in your operating system. We are here using Born shell(sh) and bash in linux ubuntu. cat /etc/shells #it will give us following shells /bin/sh # Bourne Shell /bin/bash # Bourne again shell unix and windows /bin/rbash # Restricted Shell … Continue reading 1. Shell script comment variable and wildcard
MongoDB export (mongoexport) using aggregation
When we are thinking for exporting data in csv, tsv or json format from MongoDB then probably one tool we are using that is mongoexport. This is pretty straight forward and setting up all parameters will get back your desired data in desired format, but in this article we are talking about some situation which … Continue reading MongoDB export (mongoexport) using aggregation