pass mongodb info to javasript function in html

How can I pass my mongodb data into Twitter bootstrap Typeahead?

this is my html file in which i have used typeahead.

<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
    $('input.typeahead').typeahead({
      name: 'accounts',
      local: ['Audi', 'BMW', 'Bugatti', 'Ferrari', 'Ford', 'Lamborghini', 'Mercedes Benz', 'Porsche', 'Rolls-Royce', 'Volkswagen']
    });
});  
</script>
</head>
</html>

My Question:- In the above function how can I pass a mongodb array into the above function?