Pro MongoDB Development [2016]
Deepak Vohra, "Pro MongoDB Development" 2016 | ISBN-10: 1484215990 | 504 pages | true PDF | 36 MBPro MongoDB Development is about MongoDB, a NoSQL database based on the BSON (binary JSON) document model. The book discusses all aspects of using MongoDB in web applications: Java, PHP, Ruby, JavaScrPro MongoDB DevelopmentCopyright 2015 by Deepak vohraThis work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of thematerial is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,broadcasting, reproduction on microfilms or in any other physical way, and transmission or informationtorage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology nowknown or hereafter developed. Exempted from this legal reservation are brief excerpts in connection withreviews or scholarly analysis or material supplied specifically for the purpose of being entered and executedon a computer system, for exclusive use by the purchaser of the work. Duplication of this publication orparts thereof is permitted only under the provisions of the Copyright Law of the Publisher's location, in itscurrent version, and permission for use must always be obtained from Springer. Permissions for use may beobtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution underthe respective Copyright LawISBN-13(pbk):978-1-4842-1599ISBN-13( electronic:978-1-4842-1598-2Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbolwith every occurrence of a trademarked name, logo, or image we use the names, logos, and images onlyin an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of thetrademarkThe use in this publication of trade names, trademarks, service marks, and similar terms, even if they arenot identified as such, is not to be taken as an expression of opinion as to whether or not they are subject toproprietary rightsWhile the advice and information in this book are believed to be true and accurate at the date of publicationneither the authors nor the editors nor the publisher can accept any legal responsibility for any errors oromissions that may be made. The publisher makes no warranty, express or implied, with respect to thematerial contained hereinManaging Director: Welmoed SpahrLead Editor: Steve AnglinTechnical Reviewers: Manuel Jordan, John Yeary, and Massimo NardoneEditorial Board Steve Anglin, Louise Corrigan, Jonathan Gennick, Robert Hutchinson,Michelle Lowman, James Markham, Susan McDermott, Matthew Moodie, Jeffrey Pepper,Douglas Pundick, Ben Renow-Clarke, Gwenan Spearing, Steve WeissCoordinating Editor: Mark PowersCopy editor: Karen JamesonCompositor: SPi GlobalIndexer: SPi GlobalArtist: SPi GlobalDistributed to the book trade worldwide by Springer Science+ Business Media New York,ail.ng Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505e-mailorders-ny@springer-sbm.comorvisitwww.springeronline.comApressMedia,LlcisaCaliforniaLlcand the sole member (owner) is Springer Science Business Media Finance Inc(SSBM Finance Inc)SSBM Finance Inc is a Delaware corporationForinformationontranslationspleasee-mailrights@apress.com,orvisitwww.apress.comApress and friends of ed books may be purchased in bulk for academic, corporate, or promotional useeBook versions and licenses are also available for most titles. For more information, reference our SpecialBulkSales-ebookLicensingwebpageatwww.apress.com/bulk-salesAny source code or other supplementary materials referenced by the author in this text is available toreadersatwww.apress.com/9781484215999.Fordetailedinformationabouthowtolocateyourbookssourcecodegotowww.apress.com/source-code/.ReaderscanalsoaccesssourcecodeatSpringerlinkintheSupplementary Material section for each chapter.Contents at a glanceAbout the authorAbout the technical reviewers■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■XVIntroduction■■■■■■■■■■XVIChapter 1: Using a Java client with MongoDB■■■口■■■■■■■■■■■■■■■■■■■■■■■■■■Chapter2: Using the Mongo Shell,,…,…,,…,,…,…,39Chapter 3: Using MongoDB with PHP89Chapter 4: Using MongodB with Ruby m mammin 129Chapter 5: Using MongoDB with Node.js.mmmnmnmammman 177Chapter 6: Migrating an Apache Cassandra Table to MongoDB mamma 243Chapter 7: Migrating Couchbase to MongoDB.mmmmmmmmm 273Chapter 8: Migrating Oracle Database mm IaRaaIRaIRaRRaIIRaaIaaa 297Chapter 9: Using Kundera with MongoDB mmmmammmmmamm 305Chapter10: Using Spring Data with MongoDB.,………,,,………………,345Chapter 11: Creating an apache hive Table with MongoDB■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■405Chapter 12: Integrating MongoDB with Oracle Database in OracleData Integratoraa427ContentsAbout the authorAbout the technical reviewersIntroduction■■■■■■■■■■Chapter 1: Using a Java client with MongoDBSetting Up the environmentCreating a Maven Project2Creating a bson documentUsing a Model to create a bS0 N Document….,…16Getting Data from MongoDB22Updating Data in MongoDB26Deleting data in MongoDB32SummaryDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD37Chapter 2: Using the Mongo Shell aammamaaaaanmnmmmamam 39Getting started39Setting Up the Environment.……39Starting the Mongo Shell40Running a command or method in Mongo Shell.Using databasesGetting Databases InformationCreating a database Instance46Dropping a Database….....,.,…,,,47CONTENTSUsing Collections…48Creating a CollectionDropping a collection52Using Documents53Adding a document…53Adding a Batch of Documents.….,,…,………56Saving a document60Updating a document.……68Updating Multiple DocumentsFinding0 ne document..……74Finding All Documents.…..,,,,,,……75Finding Selected Fields………6Using the cursor80Finding and Modifying a document……………………82Removing a Document…,,…,,…,…,…,……………85Summary…87Chapter 3: Using MongoDB with PHP■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■89Getting started89Overview of the PHP MongoDB Database Driver............89Setting Up the Environment91Installing PHP…面m,日面a面面面a,日面面a日面面面面日面面量a日面面面日面面92Installing php driver for mongodb93Creating a Connection ......................................................................94Getting database info97Using collections…98Getting a collection.........,日面a面面面a,日面面a日面面面面日面面量a日面面面日面面99Dropping a collection .101Using Documents……,102Adding a Document102Adding multiple documents.106Adding a batch of documents,日面a面面面a,日面面a日面面面面日面面量a日面面面日面面量重107CONTENTSFinding a Single Document110Finding All Documents.,,………12Finding a subset of Fields and documents114Updating a Document.…Updating Multiple Documents……120Saving a documentRemoving a Document….,,,,,,,,…,……125Summary128Chapter 4: Using MongoDB with Ruby.■■■■129Getting started129Overview of the Ruby Driver for MongoDB129Setting Up the Environment131Installing Ruby131Installing devkitInstalling Ruby Driver for MongoDB日日日日日日日日自日日自日日自日日日日日日日面日面日面日面日面日面日面日面日面日面日面日面日面日面134Using a Collection136Creating a Connection with MongoDB.Connecting to a Database......................139Creating a collection143Using Documents.memmmnmmmananaoemnnmnnmnnminonn 147Adding a document ............................................................................................147Adding Multiple Documents...,,,,,,…,,,…,……………151Finding a Single Document156Finding Multiple Documents158dating documents ........................................................................................162Deleting Documents169Performing Bulk Operations173Summary176CONTENTSChapter 5: Using MongoDB with Node.js.umamnnmmnnn 177Getting Started177Overview of Node js Driver for MongoDB177Setting Up the Environment178Installing MongoDB Server178Installing Node js178Installing the Node js Driver for MongoDB185Using a connection…186Creating a MongoDB Connection186Using the database .191Using a collection198Using Documents205Adding a Single document……205Adding multiple documents208Finding a Single Docum210Finding All Documents.…..,,…,……………………213Finding a subset of Documents215Using the cursor…....,..,.,.,.,.,…,日面a面面面a,日面面a日面面面面日面面量a日面面面日面217Finding and Modifying a Single Document221Finding and removing a single document....…………224Replacing a Single Document.……227pdating a Single Document.,日面a面面面a,日面面a日面面面面日面面量a日面面面日面面量重229Updating multiple documents233Removing a Single document.…………235Removing Multiple documents ..................................................................................237Performing Bulk Write Operations,日面a面面面a,日面面a日面面面面日面面日面面面面日面面量239Summary….……242CONTENTSChapter 6: Migrating an Apache Cassandra Table to MongoDB243Setting up the environment243Creating a Maven Project in Eclipse245Creating a Document in Apache Cassandra255Migrating the cassandra Table to MongoDB263Summary272Chapter 7: Migrating Couchbase to MongoDB mmmmmmmmm 273Setting Up the environment273Creating a maven project……274Creating Java Classes.Configuring the Maven Project281Adding Documents to Couchbase283Creating a Couchbase ViewDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD288Migrating Couchbase Documents to MongoDB....………292SummaryDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD296Chapter 8: Migrating Oracle Database■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■口■■■■■■■■口297Overview of the mongoimport Tool297Setting Up the Environment298Creating an Oracle Database Table299Exporting an Oracle Database Table to a cSv File299Importing Data from a CSv File to MongoDB301Displaying the JSON Data in MongoDB.302Summary.304Chapter 9: Using Kundera with MongoDB naaman 305Setting Up the Environment306Creating a mongo db collection306Creating a Maven Project in Eclipse. mamennnnnanananannamemennnnnanananann 307Creating a JPA Entity class312CONTENTSConfiguring JPA in the persistence. xml Configuration File318Creating a JPA Client Class325Running CRUD Operations…,,,…327Creating a Catalog328Finding a Catalog Entry Using the Entity clas328inding a catalog Entry Using a JPA Query......…………329Updating a catalog Entry...,.,,.,……..,330Deleting a catalog entry330The Kundera-Mongo JPA Client Class331stalling the Maven Project.....,,…,…………………333Running the Kundera-Mongo JPA Client Class338Invoking the KunderaClient Methods339Summary343Chapter 10: Using Spring Data with MongoDBg345Setting Up the environment.mmmmmmmammammmmmaasananemmmmmnnan, 345Creating a Maven project346Installing Spring Data MongoDB350Configuring JavaConfig351Creating a Model353Using Spring Data MongoDB with Template354Creating a MongoDB Collection.................………356Creating document Instances358Adding a Document..,……………358Adding a Document Batch361Finding a Document by Id........363Finding one Document………364Finding all documents368Finding Documents Using a Query370
下载地址
用户评论
比较入门,参考一下