You are on page 1of 27

Mongo DB

Installation

1. Install the mongo DB setup file.

2. Next> Check “I accept the terms in the Lincence Agreement”>Next


3. Select complete>Next

4. Create the folder as “MongoDB” .


5. Inside MongoDB, create two folder like Data and Log

6. Copy the file path in Data folder and paste in the Data Directory(e.g:D:MongoDB\Data)
7. Copy the file path in log folder and paste in the Log Directory(e.g:D:MongoDB\log)
8. Select service as Network Service user>Next
9. Uncheck the Install Mongo compass>Next
10. Click to Install>Finish
Replace Config File:

1. Go to “C:\Program Files\MongoDB\Server\4.2\bin”
2. Select mongod.cfg file.
3. Right click>Open with Notepad++

4. Change the Bind ip as “0.0.0.0” and Remove # before Security and Security as “authorization:
'enabled'” and save
Note: Better to Copy “authorization: 'enabled'” in the mongod.cfg file in \\10.199.4.12\Shared
Folders\Projects\MaxBlox\Release\MaxBlox 6.0\MongoDBComponents and Paste in
“C:\Program Files\MongoDB\Server\4.2\bin” mongod.cfg.
5. Restart the MongoDb Server in the Service

Create Admin User:

1. Go to C:\Program Files\MongoDB\Server\4.2\bin
2. Add the given createAdminuser.js file in mongo installed destination bin folder
3. Update the user and pwd in the createAdminuser.js.
4. Select the mongo.exe file and right click “Run as administrator”

5. Run the command as “Use admin”


6. Run the Command " load("createAdminUser.js");

Enable Firewall:
1. Go to Start and search Windows Firewall and Advanced settings.
2. Click Inbound rules
3. Click to add new rule.

4. Select the rule as “Program”


5.

6. Click next
7. Click to browse and select the Path
”C:\ProgramFiles\MongoDB\Server\4.2\bin\mongod.exe”

8. Select the action as “Allow the connection”


9. Click next
10. Click Next.
11. Select all the profile and click next.
12. Enter the Name: Mongod.

13. Click to Finish.


14. Click to Inbound
15. Right click the mongod
16. If the rule is not enable, Enable the rules.
17. Click to Outbound.

18. Click to add new rule.


19. Select the rule as “Program”
20. Click next
21. Click to browse and select the Path
”C:\ProgramFiles\MongoDB\Server\4.2\bin\mongod.exe”

22.
23. Click Next
24. Select “Allow the connection” in actions

25. Click Next


26. Enter the Name as “Mongod”.
27. Click Finish.
28. Click the Outbound
29. Right click the mongod
30. If the rule is not enable, Enable the rules.

Setup Environmental Variables:


1. Find your mongoDB bin folder
2. Copy the bin path “C:\Program Files\MongoDB\Server\4.2\bin”
3. Press windows button, type env, Windows will suggest “Edit the System Environment
Variables”, click that.
4. On the Advanced tab, click “Environment Variables”

5. Double click the Path


6. Paste the Variable Value as “C:\Program Files\MongoDB\Server\4.2\bin”
7. Click ok>ok

Test connection:
1. Start> Run
2. Run the command as “mongo.exe --username user1 --password pwd1
--authenticationDatabase admin --host 10.199.4.22 --port 27017 "

3. Go to “C:\Program Files\MongoDB\Server\4.2\bin”
4. Open “createAdminUser.js” file
5. To check the users and pwd
6. Update the same username and password in the maxbloxSearch.in

Note: Want to create new user in the mongoDB

1. Go to “C:\Program Files\MongoDB\Server\4.2\bin”
2. In mongo.exe file , Right click “Run as administrator”
3. Hit enter “use admin”
4. Hit enter “db.auth({“user”:”User1”,”pwd”:”pwd1”});”
5. E.g: “db.auth({“user”:”sa”,”pwd”:”Cellaradmin”});”
6. Hit enter “load(“createAdminUser.js”);”

Run MBUpgrade Exe file Steps:

1. In MBUpgradeCompanySearchData folder: Copy the maxblox.ini and maxblox_search.ini file in


the deployment path and paste in the MBUpgradeCompanySearchData folder.
2. In UpgradeConfig, remove the server and company value.
3. Click the MBUpgradeCompanysearchData

4. MBUpgradeCompanySearchData, Right click to click “Run as Adminstrator”


5. Select Application Companies as “Maxblox”

6. Click load companies


7. Click Create Search Data
8. After the complete the exe, click ok.
If we want to run the exe for one company.
1. Go to D:\upgradeFile\MBUpgradeCompanySearchData
2. Open the UpgradeConfig.xml and update the company af_row_id and server
3. E.g: <include company> 13f73bf1eefb52ef </ include company>

4.

Mongo Compass:

1. Install Mongo compass


2. Fill the login credentials like Hostname and Authentication.
3. Hostname: 10.199.4.22
4. Port: 27017
5. Select authentication as “Username/password”
6. Username: Maxblox_Admin
7. Password: M@xbloxAdmiN#2017!
8. Authentication Database: admin
9. Click to Connect.
10. Click to “CREATE FAVOURITES”, to save the credentials for future use.
11. Select DB to view the record.

12. After select the DB, it displays “mbSearchableRecords”


13. Click mbSearchRecords, it displays the records in the DB.

14. Table: Display the record in table structure


15. List: Display the record in list format

16. Filter:
1. Used to retrieve the data
2. Syntax: {field name:” Value”}
3. Click to “FIND”.

4. View searchableData for the filtered page


5. Expand searchableData
17. Click object to view the searchable record.

18. “K” as Key and “V” refers to Value


19. Click “RESET” to filter the new record

20. Expand Options

Project: View particular data in the page.


Syntax: {“SearchableData”:1} (Show Key and Value)
{“SearchableData.K”:1} (Show only Key)
{“SearchableData.V”:1} (Show only Value)
21. Sort: Used to display the record in ascending/descending.
Syntax: {created_at:1} (1 refers to asc)
{created_at: -1} (1 refers to desc)

22. Skip: Used to skip the record.


E.g.: Want to skip second record. (Skip:2)
23. Limits: Used to display the number of record to displayed.
24. View the recent query used.
Click “Toggle Query History”.
25. Save the favorites query.
Click “Favorites Query”

26. Enter the Favorite Name


Click to save the query

27. If we want to view the Favorites Query.


Click to “FAVORITES”
28. Filter the DB, enter the DB name in the “Filter your data”

29. Enter the DB name, it shows the result.

You might also like