Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via composer

mongodb/mongodb 1.17.0

MongoDB driver library
Package summary
Share
0
issues
2
licenses
4
MIT
1
Apache-2.0
Package created
19 Dec 2014
Version published
15 Nov 2023
Maintainers
3
Total deps
5
Direct deps
4
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
jean85/pretty-package-versions@2.0.6
psr/log@3.0.0
symfony/polyfill-php80@v1.29.0
symfony/polyfill-php81@v1.29.0

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
mongodb/mongodb@1.17.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of mongodb/mongodb 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
jean85/pretty-package-versions2.0.6-MIT
prod
psr/log3.0.06.77 kBMIT
prod
symfony/polyfill-php80v1.29.0-MIT
prod
symfony/polyfill-php81v1.29.04.96 kBMIT
prod

Visualizations

Frequently Asked Questions

What does mongodb/mongodb do?

The MongoDB PHP Library, known as mongodb/mongodb, is a high-level abstraction layer over the lower-level PHP driver for MongoDB (mongodb extension). It is designed to provide developers with a complete and user-friendly API similar to other MongoDB drivers. The extension by itself provides limited functionalities for executing commands, queries, and write operations. In contrast, this library encompasses abstractions for client, database, and collection objects, in addition to methods for CRUD operations and daily commands such as index and collection management. If you are developing an application with MongoDB, it would be more beneficial to utilize this library or another high-level abstraction instead of solely depending on the extension.

How do you use mongodb/mongodb?

Using the mongodb/mongodb library is straightforward with Composer. You need to run the following command in your project root:

$ composer require mongodb/mongodb

Also, the library requires the mongodb extension to be installed:

$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

A typical usage might look like this:

<?php
require 'vendor/autoload.php'; // include Composer's autoloader

$client = new MongoDB\Client("mongodb://localhost:27017");
$collection = $client->demo->beers;

$result = $collection->insertOne( [ 'name' => 'Hinterland', 'brewery' => 'BrewDog' ] );

echo "Inserted with Object ID '{$result->getInsertedId()}'";

Here, MongoDB\Client is your gateway to the driver's functionality. You specify the server's location upon instantiation. Then, you can select your database and collection and perform operations like insertOne.

Where are the mongodb/mongodb docs?

The official documentation for the mongodb/mongodb library can be accessed at the following URLs:

Comprehensive information on installation, usage examples, and the library architecture can be found within these resources.