1. Through the Java based bean metadata@Configuration Public class AppConfig {publicthrows unknownhostexceptioin {returnnew Mongo ("localhost");}}The above method contains exception handling, which is not what we want.Therefore, should try to use the following way Mongofactorybean, or later XML way.@Configuration Public class AppConfig {publicnew Mongofactorybean (); Mongo.sethost ("localhost" ); return MONGO;}}2. Via XML based metadataXML version= "1.0" encoding= "UTF-8"?>Beansxmlns= "Http:
Tags: style blog http color using OS io arQuery operations are mainly used in two categories: query, CriteriaAll of the Find methods require a query object.1. Find directly through JSON, but this is not recommended in the code.New Basicquery ("{age: {$lt: $}, Accounts.balance: {$gt: 1000.00}}"); List Class2. It is recommended to use the Where + Query method to find.The Where method generates a criteria object, which can then be incremented by calling different methods (such as Lt,gt,and).For a m
@DBref The document association, when queried by that type, add the field name of the associated table to the field name, as follows:Criteria.where ("BlogGroup. $id"),$id represents the OID field of the associated table.OR and and union queriessuch as the query (a = 1 and b = 2) or (A = 3 and b =4), or the number of uncertainties,Then a criteria array is defined, the condition group is entered into the array, and the array is assigned to the Orcriteria method.@OverridePublic listQuery query = ne
Java.lang.management.GarbageCollectorMXBean.
Httpsessions.*:tomcat the session usage of the container. Includes the maximum number of sessions Httpsessions.max and the number of active sessions httpsessions.active. This metric information is only available when embedded Tomcat is introduced as an application container.
One of the performance indicators of the GAUGE.*:HTTP request, which is mainly used to reflect an absolute value. As in the example above , gauge.response.hello:5 indicates a
indicate no limit)
SPRING.REDIS.POOL.MAX-WAIT=-1 # Maximum idle connection in the connection pool spring.redis.pool.max-idle=8 # minimum idle connection in the connection pool spring.redis.pool.min-idle=0
# Connection time-out (milliseconds) #spring. redis.timeout= #fastdsf ################################################################### Image_server_url=http://101.200.49.60:8888/tracker_server= ##################################################
. Org.springframework.http.converter.ResourceHttpMessageConverter4. Org.springframework.http.converter.xml.SourceHttpMessageConverter5. Org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter6. Org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter7. Org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"'ConclusionResttemplate can greatly simplify the submission of form data, and co
Use the Mongotemplate template provided by spring data MongoDB for aggregation operation practices
public class Flowsizeaggregatetest{public static void Main (string[] args) throws Exception{ApplicationContext context = new Classpathxmlapplicationcontext ("Classpath*:meta-inf/spring/*.xml");Mongotemplate mongotemplat
Paging query on the basis of the previous article Spring Data MongoDB Environment defines a common paging parameter class that implements the Pageable interface
Import java.io.Serializable;
Import org.springframework.data.domain.Pageable;
Import Org.springframework.data.domain.Sort;
public class Springdatapageable implements Serializable, pageable {priva
This article is reproduced to: http://blog.csdn.net/congcong68/article/details/47624221
one. Brief introduction
Springdata MongoDB provides org.springframework.data.mongodb.core.MongoTemplate to the MongoDB find operation, we last introduced a basic document query, we introduced today paging query, paging query is returned to the matching document cursor. The ability to modify query restrictions, jumps, a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.