Created
May 28, 2018 14:37
-
-
Save jvelilla/a7903dee65df1282bbf64606fd7e999f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class | |
| APPLICATION | |
| create | |
| make | |
| feature {NONE} -- Initialization | |
| make | |
| -- Run application. | |
| local | |
| l_client: MONGODB_CLIENT | |
| l_database: MONGODB_DATABASE | |
| do | |
| -- Initialize and create a new mongobd client instance. | |
| create l_client.make ("mongodb://127.0.0.1:27017") | |
| print ("Connected to the database successfully%N") | |
| -- Accessing a database | |
| l_database := l_client.database ("newDB") | |
| -- Exists collection "newCollection"? | |
| if l_database.has_collection ("newCollection") then | |
| print ("Collection newCollection exists%N") | |
| else | |
| print ("Collection newCollection does not exists%N") | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment