Example usage for org.springframework.data.mongodb.core CollectionOptions getSize

List of usage examples for org.springframework.data.mongodb.core CollectionOptions getSize

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core CollectionOptions getSize.

Prototype

public Optional<Long> getSize() 

Source Link

Document

Get the size in bytes the collection should be limited to.

Usage

From source file:org.springframework.data.mongodb.core.MongoTemplate.java

protected DBObject convertToDbObject(CollectionOptions collectionOptions) {
    DBObject dbo = new BasicDBObject();
    if (collectionOptions != null) {
        if (collectionOptions.getCapped() != null) {
            dbo.put("capped", collectionOptions.getCapped().booleanValue());
        }//from  ww  w .  ja  v  a 2s .  c  o m
        if (collectionOptions.getSize() != null) {
            dbo.put("size", collectionOptions.getSize().intValue());
        }
        if (collectionOptions.getMaxDocuments() != null) {
            dbo.put("max", collectionOptions.getMaxDocuments().intValue());
        }
    }
    return dbo;
}