<commit_before>const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
//const sanitizeName = require('string-capitalize-name');

//const movies = require('../models/movies');
//const config = require('../config/dbConnect.js');

// Use Node's default promise instead of Mongoose's promise library
//mongoose.Promise = global.Promise;

// Connect to the database
/*mongoose.connect(config.db);
let db = mongoose.connection;
*/
var Schema = mongoose.Schema;
var moviesSchema = new Schema({
  moviename:  String,
  movieImage: String,
  language:   String,
  isBigMovie: Number,
  rating: Number,
  movieurls: String,
  MovieDetails: String
});

var moviesData = mongoose.model('movies', moviesSchema);

// READ

router.get('/', (req, res) => {
  console.log("apiiiiiiii called"); 
  moviesData.find(function(err,data){
  	console.log('data'+data);
  	res.send(data);
  });
});<commit_msg>getMovies api - able to get all details by defining schema - change in schema type<commit_after>const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
//const sanitizeName = require('string-capitalize-name');

//const movies = require('../models/movies');
//const config = require('../config/dbConnect.js');

// Use Node's default promise instead of Mongoose's promise library
//mongoose.Promise = global.Promise;

// Connect to the database
/*mongoose.connect(config.db);
let db = mongoose.connection;
*/
var Schema = mongoose.Schema;
var moviesSchema = new Schema({
  moviename:  String,
  movieImage: String,
  language:   String,
  isBigMovie: Number,
  rating: Number,
  movieurls: Schema.Types.Mixed,
  MovieDetails: Array
});

var moviesData = mongoose.model('movies', moviesSchema);

// READ

router.get('/', (req, res) => {
  console.log("apiiiiiiii called"); 
  moviesData.find(function(err,data){
  	console.log('data'+data);
  	res.send(data);
  });
});
{'fraction_non_alphanumeric': 0.15762538382804503, 'fraction_numerical': 0.0, 'mean_word_length': 4.522598870056497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3581964', 'n_tokens_mistral': 610, 'n_tokens_neox': 616, 'n_words': 155}