Skip to content

Instantly share code, notes, and snippets.

@jvelilla
Created May 28, 2018 14:37
Show Gist options
  • Select an option

  • Save jvelilla/a7903dee65df1282bbf64606fd7e999f to your computer and use it in GitHub Desktop.

Select an option

Save jvelilla/a7903dee65df1282bbf64606fd7e999f to your computer and use it in GitHub Desktop.
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