SlideShare una empresa de Scribd logo
1 de 6
MongoDB Pagination 0.3 From Presented By: Sougata Pal (Skall) [email_address] November 28, 2011  Download Link:  https://sourceforge.net/projects/mongopagination/
MongoDB Pagination 0.3 Introduction to  MongoDB Pagination MongoDB Pagination is the PHP Pagination tool developed by Techunits and has been used by many of it's partners; e.g. Buzzers.co.za, Trivian Mobile API, CelebRise Network etc. MongoDB Pagination is already been indexed by Mongo team on their official site as follows: http://www.mongodb.org/display/DOCS/PHP+Libraries%2C+Frameworks%2C+and+Tools
MongoDB Pagination 0.3 Initialize MongoDB Pagination /* Include MongoDB Pagination Library into your code */ require_once('MongoPagination/MongoPagination.php'); /* Connect to MongoDB server */ $mongoConn = new Mongo(); $mongoHandler = $mongoConn->testDatabase; /* Initiate MongoDB Pagination Object with MongoConnection Handler */ $pagination = new MongoPagination($mongoHandler); Note:  Once MongoDB Pagination Object is Initiated you can directly pass MongoDB find(), sort() parameters into it. You wil not require any abstrcted layer to pass through.
MongoDB Pagination 0.3 MongoDB Pagination with Limit $limit = 20; $pagination->setQuery(array( '#collection' =>  'testCollection', '#find' =>  array( 'key'   =>  'mykey' ), '#sort' =>  array( 'created' =>  -1 ), ), $limit); /* Paginate the result with repect to the parameter you have passed via setQuery()  $dataSet = $pagination->Paginate(); Note: The resultset will contain follwing fields witj only limit is passed into setQuery, $dataset['dataset']  = "ARRAY / STRING - raw data array/string" $dataset['totalItems']  = "INTEGER - total number of documents available with respect to the query"
MongoDB Pagination 0.3 MongoDB Pagination with Limit $itemsPerPage  = 5; $currentPage  = 1; $pagination->setQuery(array( '#collection' =>  'testCollection', '#find' =>  array( 'key'   =>  'mykey' ), '#sort' =>  array( 'created' =>  -1 ), ), $currentPage, $itemsPerPage); $dataSet  = $pagination->Paginate(); $page_links = $pagination->getPageLinks(); Note: The resultset will contain follwing info, $dataset['dataset']  = "ARRAY / STRING - raw data array/string" $dataset['totalPages']  = "INTEGER - total pages calculated with respect to $itemsPerPage" $dataset['totalItems']  = "INTEGER - total number of documents available with respect to the query"
MongoDB Pagination 0.3 Thank you for your valuable time Developers Email:  [email_address] Community Discussion:  [email_address] Download Link:  https://sourceforge.net/projects/mongopagination/

Más contenido relacionado

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

MongoDB Pagination 0.3

  • 1. MongoDB Pagination 0.3 From Presented By: Sougata Pal (Skall) [email_address] November 28, 2011 Download Link: https://sourceforge.net/projects/mongopagination/
  • 2. MongoDB Pagination 0.3 Introduction to MongoDB Pagination MongoDB Pagination is the PHP Pagination tool developed by Techunits and has been used by many of it's partners; e.g. Buzzers.co.za, Trivian Mobile API, CelebRise Network etc. MongoDB Pagination is already been indexed by Mongo team on their official site as follows: http://www.mongodb.org/display/DOCS/PHP+Libraries%2C+Frameworks%2C+and+Tools
  • 3. MongoDB Pagination 0.3 Initialize MongoDB Pagination /* Include MongoDB Pagination Library into your code */ require_once('MongoPagination/MongoPagination.php'); /* Connect to MongoDB server */ $mongoConn = new Mongo(); $mongoHandler = $mongoConn->testDatabase; /* Initiate MongoDB Pagination Object with MongoConnection Handler */ $pagination = new MongoPagination($mongoHandler); Note: Once MongoDB Pagination Object is Initiated you can directly pass MongoDB find(), sort() parameters into it. You wil not require any abstrcted layer to pass through.
  • 4. MongoDB Pagination 0.3 MongoDB Pagination with Limit $limit = 20; $pagination->setQuery(array( '#collection' => 'testCollection', '#find' => array( 'key' => 'mykey' ), '#sort' => array( 'created' => -1 ), ), $limit); /* Paginate the result with repect to the parameter you have passed via setQuery() $dataSet = $pagination->Paginate(); Note: The resultset will contain follwing fields witj only limit is passed into setQuery, $dataset['dataset'] = "ARRAY / STRING - raw data array/string" $dataset['totalItems'] = "INTEGER - total number of documents available with respect to the query"
  • 5. MongoDB Pagination 0.3 MongoDB Pagination with Limit $itemsPerPage = 5; $currentPage = 1; $pagination->setQuery(array( '#collection' => 'testCollection', '#find' => array( 'key' => 'mykey' ), '#sort' => array( 'created' => -1 ), ), $currentPage, $itemsPerPage); $dataSet = $pagination->Paginate(); $page_links = $pagination->getPageLinks(); Note: The resultset will contain follwing info, $dataset['dataset'] = "ARRAY / STRING - raw data array/string" $dataset['totalPages'] = "INTEGER - total pages calculated with respect to $itemsPerPage" $dataset['totalItems'] = "INTEGER - total number of documents available with respect to the query"
  • 6. MongoDB Pagination 0.3 Thank you for your valuable time Developers Email: [email_address] Community Discussion: [email_address] Download Link: https://sourceforge.net/projects/mongopagination/