万本电子书0元读

万本电子书0元读

顶部广告

Learning Mongoid电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Gautam Rege

出  版  社:Packt Publishing

出版时间:2013-12-12

字       数:69.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
A step-by-step tutorial with focused examples that will help you build scalable, high performance Rails web applications with Mongoid.If you are an application developer who wants to learn how to use Mongoid in a Rails application, this book will be great for you. You are expected to be familiar with MongoDB and Ruby.
目录展开

Learning Mongoid

Table of Contents

Learning Mongoid

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers and more

Why Subscribe?

Free Access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. What's so Awesome about Mongoid?

A practical approach using the Sodibee library system

Checking prerequisites

Ruby version

MongoDB version

Setting up Sodibee

Creating models

Testing the models

Introducing Moped

Dynamic attributes

Introducing Origin

Notice about Mongoid 2.x

Mongoid and MongoMapper

Summary

2. Mongoid Document Model

The Mongoid document

Basic attributes

Arrays and hashes

Date and time attributes

Serialization with Mongoize

Field aliases

Embedded documents

Localization

Mass assignment and security

Summary

3. Persisting Documents

MongoDB persistence strategy

Binary JSON (BSON)

Memory maps, delayed sync, and journals

Creating documents

Updating documents and attributes

Database locks and transactions

Applications and lock versioning

The MongoDB findAndModify method

Atomic attribute updates

Dynamic attributes

Nested attributes

Validations

Callbacks

Summary

4. Mongoid Relations

Configuring relationships

Common options for all relations

:class_name

:inverse_of

Relation-specific options

has_one – the one-to-one relation

:as

:autosave

:autobuild

:dependent

:primary_key

:foreign_key

:validate

has_many – the many-to-one relation

:order

:before_add, :after_add, :before_remove, and :after_remove

The belongs_to relation

:index

:polymorphic

:touch

:counter_cache

has_and_belongs_to_many – the many-to-many relation

:inverse_of

Polymorphic relations

embeds_many – embedding many documents

:cascade_callbacks

:store_as

:cyclic

embeds_one – embed one document

embedded_in – resolving children

Embedded polymorphic relations

Summary

5. Mongoid Queries

Origins of Origin

Query selectors

Overloading the Symbol class

Mongoid criteria

Queries on arrays and hashes

Scopes

Atomic modifiers

find_and_modify

Querying with indexed fields

Covered queries

The aggregation framework

Geolocation queries

Summary

6. Performance Tuning

MongoDB environment

Indexes

Write concern

Compound index

Multikey index

Hashed index

Text index

IdentityMap

n+1 query problem and eager loading

MapReduce and the aggregation framework

Using the aggregation framework

Choosing between MapReduce and the aggregation framework

Monitoring query performance

Profiling MongoDB

Statistical data

Hint and currentOp

Good practices and recommendations

Summary

7. Mongoid Modules

Timestamping

Versioning

Paranoia

Acts as state machine (aasm)

carrierwave

mongoid-audit

devise

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部