Question: I've written a custom comparer that sorts strings and numeric. This all works fine.

However I'm rewriting my whole BLL to use LINQ where possible as I do like the syntax. Now i'm stumbling onto using my custom comparer. As LINQ syntax (query based) will not allow to use custom comparers Im now using method based LINQ.

But in order to make it to work, I need to do an intermediate ToList(), which again works fine, but looks somewhat weird to me? 

```
        var areas = cc.Areas.Where(a => a.ProjectId == ProjectId).ToList()
                            .OrderBy(a => a.UnitNumber, new Common.Comparers.StringNumericComparer());

```

Now i'm unsure if this has to do with the SQL query to be executed first and then the results sorted in my C# code side, but this is beyond my knowledge.
Does ToList() force the first part of the linq query to be executed on the database?

Answer: 
If you look into the source code of jeroenooms/mongolite you can see that it doesn't support authentication yet:

<https://github.com/jeroenooms/mongolite/blob/master/R/mongo.R>

```
mongo_collection_new <- function(uri = "mongodb://localhost", db = "test", collection = "test"){
 stopifnot(is.character(uri))
 stopifnot(is.character(db))
 stopifnot(is.character(collection))
 .Call(R_mongo_collection_new, uri, db, collection)
}

```
just change the order :

**mongo( url = "mongodb://localhost",db = "test",collection = "test")**