Upload
heather-mendoza
View
31
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Mongo DB Driver for WP7. Athens-Mongo DB-User-Group 3 rd Meeting By Nick Tsapakis. Intro. What is a Mongo DB driver Why WP7 Tools used How we worked Driver explained - Demo. Tools used. Netcat Wireshark WP7 SDK – VS2010 – C# Mongo DB. Specification. Mongo DB wire protocol - PowerPoint PPT Presentation
Citation preview
Mongo DB Driver for WP7
Athens-Mongo DB-User-Group3rd Meeting
By Nick Tsapakis
Intro
• What is a Mongo DB driver
• Why WP7
• Tools used
• How we worked
• Driver explained - Demo
Tools used
• Netcat
• Wireshark
• WP7 SDK – VS2010 – C#
• Mongo DB
Specification
• Mongo DB wire protocol
http://docs.mongodb.org/meta-driver/latest/legacy/mongodb-wire-protocol/
How we worked
• Netcat used for sending data to socket without using a program
• Data for sending placed in a file
• Command used for sending data:
nc 127.0.0.1 27017 < data_file.txt
How we worked
• Wireshark used for capturing commands – responses
• Verifying that captured messages follow Mongo DB wire protocol specification
• Sending commands we want to implement in driver (select, insert, delete)
How we worked
How we worked
How we worked
• Visual Studio 2010 with WP7 SDK – Free (run apps on emulator)
• Need registering the phone device as developer device – Not Free
• Pay approx. 100 dollars for 1 year
• I am telling you all !!!
How we worked
Driver details
• Driver consists of 2 classes
• MongodbDriver.cs is actual Driver class
• SocketClient.cs is a tcp comms class used only by MongodbDriver.cs
• MongodbDriver Methods availableFind() , insert() , remove()
Messages Request – Reply• There will be no response sent for any other message except
OP_QUERY and OP_GET_MORE messages
• You can determine if a message was successful with a getLastError command
• The database will respond to an OP_QUERY message with an OP_REPLY message
• There is no response to an OP_DELETE message
• There is no response to an OP_INSERT message
Message Request structure
Message Reply structure
How to use Driver
• Add as reference the 2 classes
• Create MongodbDriver instanceMongodbDriver mongo = new MongodbDriver(server, port, database, collection);
• Call a methodresponse = mongo.find(arguments);
Arguments is a sting with following format (eg.) -> name:magic,pass:mypass,
What is supported
• 3 methods supported for select, insert, delete
• Only AND among input parameters on the 3 methods
• Only string, Object ID types supported
• No getLastError command supported
• One OP_REPLY message supported
• Tested on WP7 phone
Demo
• Demo on WP7 SDK Emulator
• Demo on a WP7 mobile device (Nokia Lumia)
Epilogue
• Comments – suggestions
• Ideas