Close
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
Read Down
Sign in
Close
Welcome!Log into your account
Forgot your password?
Read Down
Password recovery
Recover your password
Close
Search
Logo
Subscribe
Logo
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
More
    Subscribe
    Home Applications
    • Applications
    • Database
    • Development
    • Storage

    Download the Driver From GitHub

    By
    Jeff Cogswell
    -
    May 16, 2012
    Share
    Facebook
    Twitter
    Linkedin

      eWEEK content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

      PrevNext

      1Download the Driver From GitHub

      1

      The driver is readily available for download on github, in the mongodb section.

      2Accessing the Documentation

      2

      The link on the driver page takes you to the official documentation, which includes a complete description of the entire API.

      3Installing the Driver

      3

      Although you can access the driver, readme and docs through github, the driver itself can be installed using the Node.js npm package manager.

      4Timing an Insert

      4

      Inserts performed well. More time was spent connecting to the database itself.

      5Handling Errors

      5

      When an error occurs, the driver gives back an error object. To inspect this, we simply sent it down to the browser and then pasted the text into the debugger so we could look at it as a JavaScript object.

      6The Stack Isnt Much Help

      6

      Included with the error object is a full stack trace of the actual exception that occurred. However, this isn’t very useful since it only shows the code inside the driver.

      7Performing Queries

      7

      Performing a database query requires the same approach of passing asynchronous callback functions. You can query on any of the data types as well as regular expressions.

      8Querying Without an Index

      8

      When querying a database that is not indexed, MongoDB has no choice but to do a linear search through all the records. This is not efficient and as such took several seconds to perform when searching 100,000 records.

      9Adding an Index

      9

      Adding an index in MongoDB is easy using the command prompt. This is only required once; after that, Mongo will continue to maintain the index. Therefore, there wasn’t much reason for us to do it programmatically through the driver.

      10Querying With an Index

      10

      After adding the index, the lookup was shortened dramatically, from four seconds all the way down to about 30 milliseconds.

      11MongoDB Code uses Callbacks

      11

      The code for accessing the MongoDB driver requires passing callbacks into the function calls. These callbacks allow for asynchronous operations to occur.

      PrevNext

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      MOST POPULAR ARTICLES

      Artificial Intelligence

      9 Best AI 3D Generators You Need...

      Sam Rinko - June 25, 2024 0
      AI 3D Generators are powerful tools for many different industries. Discover the best AI 3D Generators, and learn which is best for your specific use case.
      Read more
      Cloud

      RingCentral Expands Its Collaboration Platform

      Zeus Kerravala - November 22, 2023 0
      RingCentral adds AI-enabled contact center and hybrid event products to its suite of collaboration services.
      Read more
      Artificial Intelligence

      8 Best AI Data Analytics Software &...

      Aminu Abdullahi - January 18, 2024 0
      Learn the top AI data analytics software to use. Compare AI data analytics solutions & features to make the best choice for your business.
      Read more
      Latest News

      Zeus Kerravala on Networking: Multicloud, 5G, and...

      James Maguire - December 16, 2022 0
      I spoke with Zeus Kerravala, industry analyst at ZK Research, about the rapid changes in enterprise networking, as tech advances and digital transformation prompt...
      Read more
      Video

      Datadog President Amit Agarwal on Trends in...

      James Maguire - November 11, 2022 0
      I spoke with Amit Agarwal, President of Datadog, about infrastructure observability, from current trends to key challenges to the future of this rapidly growing...
      Read more
      Logo

      eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site’s focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

      Facebook
      Linkedin
      RSS
      Twitter
      Youtube

      Advertisers

      Advertise with TechnologyAdvice on eWeek and our other IT-focused platforms.

      Advertise with Us

      Menu

      • About eWeek
      • Subscribe to our Newsletter
      • Latest News

      Our Brands

      • Privacy Policy
      • Terms
      • About
      • Contact
      • Advertise
      • Sitemap
      • California – Do Not Sell My Information

      Property of TechnologyAdvice.
      © 2024 TechnologyAdvice. All Rights Reserved

      Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

      ×