package org.springframework.cloud.cloudfoundry;

import java.util.Map;

import org.springframework.cloud.service.common.MongoServiceInfo;

/**
 *
 * @author Ramnivas Laddad
 *
 */
public class MongoServiceInfoCreator extends CloudFoundryServiceInfoCreator<MongoServiceInfo> {

	public MongoServiceInfoCreator() {
		super("mongodb");

	}

	public MongoServiceInfo createServiceInfo(Map<String,Object> serviceData) {
		@SuppressWarnings("unchecked")
		Map<String,Object> credentials = (Map<String, Object>) serviceData.get("credentials");

		String id = (String) serviceData.get("name");

		String uri = (String) ((credentials.get("uri") == null) ? credentials.get("url") : credentials.get("uri"));

		return new MongoServiceInfo(id, uri);
	}

}

package org.springframework.cloud.cloudfoundry;

import java.util.Map;

import org.springframework.cloud.service.common.MongoServiceInfo;

/**
 * 
 * @author Ramnivas Laddad
 *
 */
public class MongoServiceInfoCreator extends CloudFoundryServiceInfoCreator<MongoServiceInfo> {

	public MongoServiceInfoCreator() {
		super("mongodb");

	}

	public MongoServiceInfo createServiceInfo(Map<String,Object> serviceData) {
		@SuppressWarnings("unchecked")
		Map<String,Object> credentials = (Map<String, Object>) serviceData.get("credentials");
		
		String id = (String) serviceData.get("name");
		
		String uri = (String) credentials.get("uri");

		return new MongoServiceInfo(id, uri);
	}

}

--- 
+++ 
@@ -5,7 +5,7 @@
 import org.springframework.cloud.service.common.MongoServiceInfo;
 
 /**
- * 
+ *
  * @author Ramnivas Laddad
  *
  */
@@ -19,10 +19,10 @@
 	public MongoServiceInfo createServiceInfo(Map<String,Object> serviceData) {
 		@SuppressWarnings("unchecked")
 		Map<String,Object> credentials = (Map<String, Object>) serviceData.get("credentials");
-		
+
 		String id = (String) serviceData.get("name");
-		
-		String uri = (String) credentials.get("uri");
+
+		String uri = (String) ((credentials.get("uri") == null) ? credentials.get("url") : credentials.get("uri"));
 
 		return new MongoServiceInfo(id, uri);
 	}
Add fix for MongoDb if url is used instead of uri
